Python error when running certbot-auto

#1

Hello, I’m using a certificate on Ubuntu 12.04.5 LTS (GNU/Linux 3.2.0-126-virtual i686) (hosted on DigitalOcean) for about 2 years running the update script on a weekly basis just by executing “certbot-auto renew” in cron.

Last week my certificate was successfully renewed and (according to the logs) certbot-auto was updated from 0.31.0 to 0.32.0.

The Python version 2.7.3.

Now any attempt to run certbot-auto (with any command line parameter, including ‘–version’ or even without any parameters) causes the following output:

Creating virtual environment...
Installing Python packages...
/opt/eff.org/certbot/venv/bin/python: No module named pip.__main__; 'pip' is a package and cannot be directly executed
Traceback (most recent call last):
  File "/tmp/tmp.PAUco4aVto/pipstrap.py", line 177, in <module>
    sys.exit(main())
  File "/tmp/tmp.PAUco4aVto/pipstrap.py", line 149, in main
    pip_version = StrictVersion(check_output([python, '-m', 'pip', '--version'])
  File "/usr/lib/python2.7/subprocess.py", line 544, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/opt/eff.org/certbot/venv/bin/python', '-m', 'pip', '--version']' returned non-zero exit status 1

May the old (2.7.3) python version be the cause of the issue? I found here that certbot-auto should work with even 2.6!

Thank you in advance!

Certbot auto started failing with ' No module named pip.__main__'
#2

It’s actually the old version of pip.

See this thread:

You can patch certbot-auto to work around it, but you should upgrade to a newer OS. Precise has been EOL for ages, unless you’re paying Canonical for Extended Security Maintenance.

#3

Thank you very much for the link! I downgraded to 0.31.0 version of certbot-auto and use --no-self-upgrade flag. It woks now. Here’s the solution / Github.

2 Likes
closed #4

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