Python errors with certbot-auto

I have downloaded the latest version of certbot-auto and get these error messages when I try to use it:


sudo ./certbot-auto renew --dry-run --no-bootstrap
Traceback (most recent call last):
File “/tmp/tmp.IMFnTPkAlo/fetch.py”, line 17, in
from json import loads
File “/usr/local/lib/python2.7/json/init.py”, line 108, in
from .decoder import JSONDecoder
File “/usr/local/lib/python2.7/json/decoder.py”, line 5, in
import struct
File “/usr/local/lib/python2.7/struct.py”, line 1, in
from _struct import *
ImportError: No module named _struct
WARNING: unable to check for updates.
Traceback (most recent call last):
File “”, line 16, in
File “/usr/local/lib/python2.7/distutils/version.py”, line 140, in cmp
compare = cmp(self.version, other.version)
AttributeError: StrictVersion instance has no attribute ‘version’

Any help would be appreciated.

Do you know why there’s a Python installation in /usr/local and what’s going on with it?

Does “import struct” work normally?

The _struct module is built-in; I’m pretty sure it ought to be impossible for it to fail.


Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):

I don’t know why there are python installations in /usr/local. Is that an issue?

I can run “import struct” in python with no issues.

No, but it's uncommon.

Using the same Python installation?

Actually, not using the same python installation.

So, why is cert-auto calling python2.7? In that installation I get the same error when I call “import struct”.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.