Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 ?

like image 365
Vallica Avatar asked Mar 07 '19 09:03

Vallica


1 Answers

I made the following 2 changes in certbot-auto script and it works

1st change

pip_version = StrictVersion(check_output([python, '-m', 'pip', '--version'])

to

pip_version = StrictVersion(check_output(['pip', '--version'])

2nd change

command = [python, '-m', 'pip', 'install', '--no-index', '--no-deps', '-U']

to

command = ['pip', 'install', '--no-index', '--no-deps', '-U']
like image 156
Techie Avatar answered Sep 21 '22 23:09

Techie