Debian Wheezy
/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.Xxcju1yqBr/pipstrap.py", line 177, in <module>
sys.exit(main())
File "/tmp/tmp.Xxcju1yqBr/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
Possible solutions:
- Change
certbot-auto:
--- certbot-auto 2019-10-04 17:08:55.310470864 +0300
+++ certbot-auto-new 2019-10-07 14:39:59.407460138 +0300
@@ -1502,7 +1502,7 @@
def main():
python = sys.executable or 'python'
- pip_version = StrictVersion(check_output([python, '-m', 'pip', '--version'])
+ pip_version = StrictVersion(check_output(['pip', '--version'])
.decode('utf-8').split()[1])
has_pip_cache = pip_version >= StrictVersion('6.0')
index_base = get_index_base()
@@ -1513,7 +1513,7 @@
digest)
for path, digest in PACKAGES]
# Calling pip as a module is the preferred way to avoid problems about pip self-upgrade.
- command = [python, '-m', 'pip', 'install', '--no-index', '--no-deps', '-U']
+ command = ['pip', 'install', '--no-index', '--no-deps', '-U']
# Disable cache since it is not used and it otherwise sometimes throws permission warnings:
command.extend(['--no-cache-dir'] if has_pip_cache else [])
command.extend(downloads)To make it not self-upgrade add NO_SELF_UPGRADE=1 to /etc/environment or some such.
https://community.letsencrypt.org/t/pip-error-with-certbot-auto/88200/6?u=ericb2038 certbot/certbot#6824 (comment)
- Downgrade to 0.31 and
--no-self-upgrade(orNO_SELF_UPGRADE=1):
https://community.letsencrypt.org/t/certbot-auto-started-failing-with-no-module-named-pip-main/89097/3 certbot/certbot#6824 (comment)
- Make use of
pyenv:
https://community.letsencrypt.org/t/pip-error-with-certbot-auto/88200/18 https://community.letsencrypt.org/t/pip-error-with-certbot-auto/88200/20 https://community.letsencrypt.org/t/installing-certbot-on-systems-running-outdated-versions-of-python/92041
- Upgrade
pip:
https://community.letsencrypt.org/t/pip-error-with-certbot-auto/88200/15