Let's Encrypt certbot-auto fails because a Python / pip problem

Vallica picture Vallica · Mar 7, 2019 · Viewed 9.5k times · Source

Yesterday all was fine, but today, running the same command using certbot-auto to renew a certificate, I get this :

Upgrading certbot-auto 0.31.0 to 0.32.0...
Replacing certbot-auto...
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.eUWQ3w7cFV/pipstrap.py", line 177, in <module>
        sys.exit(main())
      File "/tmp/tmp.eUWQ3w7cFV/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

I'm on Debian 7.9... someone with the same problem ?

Answer

Felipe Alonso picture Felipe Alonso · Mar 19, 2019

It's a problem with the newest versions (>= 0.32.x) over Ubuntu 12.04 and Debian 7.5.

Just clone a previous branch (I used 0.30.x):

git clone --branch 0.30.x https://github.com/letsencrypt/letsencrypt

And use the option --no-self-upgrade when you run letsencrypt. In my case:

./letsencrypt-auto certonly --no-self-upgrade --standalone -d mydomain.com

Don't forget to add --no-self-upgrade to your renew cron job.