PIP error with certbot-auto


#1

Hi all

My domain is:
webmail.zoneseekers.com

I ran this command after wget’ing the latest version:
./certbot-auto

It produced this output:
Requesting to rerun ./certbot-auto with root privileges…
Bootstrapping dependencies for Debian-based OSes… (you can skip this with --no-bootstrap)

Reading package lists… Done
Reading package lists… Done
Building dependency tree
Reading state information… Done
gcc is already the newest version.
python is already the newest version.
python-dev is already the newest version.
python-virtualenv is already the newest version.
augeas-lenses is already the newest version.
libaugeas0 is already the newest version.
ca-certificates is already the newest version.
libffi-dev is already the newest version.
libssl-dev is already the newest version.
openssl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
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.79grOEfihq/pipstrap.py”, line 177, in
sys.exit(main())
File “/tmp/tmp.79grOEfihq/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

This is on Debian 7 (yes I know I should upgrade).

If there’s not an obvious reason for the error then I’ll look into upgrading but I was just trying a simple auto renew of a cert I’ve had for a while.

Thanks!


Python error when running certbot-auto
Certbot auto started failing with ' No module named pip.__main__'
#2

I have the exact same error (nothing changed on server, worked fine before).
Running on Ubuntu 12.04
Did you find a way to fix the problem?


#3

Description of problem and its workarounds @ https://github.com/certbot/certbot/issues/6824

tl;dr; upgrade your OS or run 0.31 with --no-self-upgrade.


#4

Nothing works for me (Debian 7.11 Wheezy, yes its EOL) . Rollback to 0.30. or 0.31 also not works :confused:

I tried all workarounds on https://github.com/certbot/certbot/issues/6824, but nothing.

Any idea for me?

# certbot-auto renew --no-self-upgrade
Bootstrapping dependencies for Debian-based OSes... (you can skip this with --no-bootstrap)
OK   http://wertarbyte.de ./ Release.gpg
OK   http://wertarbyte.de ./ Release                                                                                                                      
OK   http://packages.dotdeb.org wheezy Release.gpg                                                                                                        
OK   http://wertarbyte.de ./ Packages                                                                                                                                      
OK   http://packages.dotdeb.org wheezy-php56-zts Release.gpg                                                                                                               
OK   http://packages.dotdeb.org wheezy Release                                                                                                                                                                   
OK   http://packages.dotdeb.org wheezy-php56-zts Release                                                                                                                                        
OK   http://security.debian.org wheezy/updates Release.gpg                                                                                                 
OK   http://packages.dotdeb.org wheezy/all Sources                                                                                                         
OK   http://packages.dotdeb.org wheezy/all amd64 Packages                                                                                                                    
OK   http://security.debian.org wheezy/updates Release                                                                                           
OK   http://packages.dotdeb.org wheezy-php56-zts/all Sources                                                                                     
OK   http://packages.dotdeb.org wheezy-php56-zts/all amd64 Packages                                                 
OK   http://security.debian.org wheezy/updates/main Sources                                     
OK   http://security.debian.org wheezy/updates/contrib Sources                                                         
OK   http://security.debian.org wheezy/updates/non-free Sources                                     
OK   http://security.debian.org wheezy/updates/main amd64 Packages                                                    
OK   http://security.debian.org wheezy/updates/contrib amd64 Packages                                              
OK   http://security.debian.org wheezy/updates/non-free amd64 Packages                     
OK   http://http.debian.net wheezy-backports Release.gpg                                   
OK   http://cdn.debian.net wheezy Release.gpg
OK   http://http.debian.net wheezy-backports Release
OK   http://cdn.debian.net wheezy Release         
OK   http://http.debian.net wheezy-backports/main amd64 Packages
OK   http://cdn.debian.net wheezy/main Sources      
OK   http://cdn.debian.net wheezy/non-free Sources  
OK   http://cdn.debian.net wheezy/contrib Sources
OK   http://cdn.debian.net wheezy/main amd64 Packages
OK   http://cdn.debian.net wheezy/non-free amd64 Packages
OK   http://cdn.debian.net wheezy/contrib amd64 Packages
Paketlisten werden gelesen... Fertig
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut.       
Statusinformationen werden eingelesen.... Fertig
gcc ist schon die neueste Version.
python ist schon die neueste Version.
python-dev ist schon die neueste Version.
python-virtualenv ist schon die neueste Version.
ca-certificates ist schon die neueste Version.
libffi-dev ist schon die neueste Version.
libssl-dev ist schon die neueste Version.
openssl ist schon die neueste Version.
augeas-lenses ist schon die neueste Version.
libaugeas0 ist schon die neueste Version.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 23 nicht aktualisiert.
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.eGwywBfra5/pipstrap.py", line 177, in <module>
    sys.exit(main())
  File "/tmp/tmp.eGwywBfra5/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

#5

You need to modify your local version of certbot-auto to use pip install instead of python -m pip AND use --no-self-upgrade.


#6

I confirm that it works.
I changed in certbot-auto:
pip_version = StrictVersion(check_output([python, '-m', 'pip', '--version'])
by
pip_version = StrictVersion(check_output(['pip', '--version'])

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


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

I can confirm the patch from @gery on Debian “wheezy” and Ubuntu “precise” (certbot-auto 0.32.0).


#8

I can confirm that this patch is what is needed to keep certbot working on debian wheezy.

It should be incorporated in the main trunk!


#9

isn’t wheezy already reached EOL? its LTS ended march 2018

https://www.debian.org/releases/wheezy/

you should update that


#10

I’ve changed it in /usr/local/bin/certbot-auto

now i get the error:
Installing Python packages…
File “/tmp/tmp.zokrYrwiwP/pipstrap.py”, line 149
pip_version = StrictVersion(check_output([‘pip’, ‘–version’])
^
IndentationError: unexpected indent

How to fix that?

this is part of the certbot-auto:
def main():
python = sys.executable or ‘python’
pip_version = StrictVersion(check_output([‘pip’, ‘–version’])
.decode(‘utf-8’).split()[1])
has_pip_cache = pip_version >= StrictVersion(‘6.0’)

Thanks in advance for your help.
Christian