昨天一切都很好,但今天,使用certbot-auto运行相同的命令来续订证书,我得到了以下结果:
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我用的是Debian 7.9...有同样问题的人?
发布于 2019-03-20 06:49:04
最新版本(>= 0.32.x)在Ubuntu12.04和Debian7.5上存在问题。
只需克隆前一个分支(我使用的是0.30.x):
git clone --branch 0.30.x https://github.com/letsencrypt/letsencrypt并在运行letsencrypt时使用选项--no-self-upgrade。在我的例子中:
./letsencrypt-auto certonly --no-self-upgrade --standalone -d mydomain.com不要忘记将--no-self-upgrade添加到您的更新cron作业中。
发布于 2020-03-13 14:19:26
我在certbot-auto脚本中做了以下两处更改,它可以正常工作
第一个更改
pip_version = StrictVersion(check_output([python, '-m', 'pip', '--version'])至
pip_version = StrictVersion(check_output(['pip', '--version'])第二次更改
command = [python, '-m', 'pip', 'install', '--no-index', '--no-deps', '-U']至
command = ['pip', 'install', '--no-index', '--no-deps', '-U']发布于 2019-03-07 18:41:01
看起来这是在升级你的certbot包的过程中发生的?
没有名为pip.__main__的模块;'pip‘是一个包,不能直接执行
这可能是因为在找到实际的pip模块之前,Python在其包含路径中遇到了名为pip的文件夹。调试它有点棘手(您需要找出Python的包含路径在这个上下文中是什么,然后在这些路径中搜索错误的文件夹),但是也许您可以通过删除并重新安装certbot-auto包来解决这个问题。
(您的Debian版本非常古老,但certbot版本并非如此,它使用的是virtualenv作为其依赖项,因此可能不是这样。)
https://stackoverflow.com/questions/55040526
复制相似问题