让加密certbot-auto失败,因为Python / pip问题

问题描述 投票:4回答:2

昨天一切都很好,但今天,使用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 ...有同样问题的人?

python lets-encrypt certbot
2个回答
18
投票

与Ubuntu 12.04和Debian 7.5相比,最新版本(> = 0.32.x)存在问题。

只是克隆一个前一个分支(我使用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添加到续订计划中。


0
投票

看来这是在升级certbot包的过程中发生的吗?

No module named pip.__main__; 'pip' is a package and cannot be directly executed

这可能是因为Python在找到实际的pip模块之前在其包含路径中遇到名为pip的文件夹。调试它有点棘手(您需要找出Python在此上下文中包含的路径,然后搜索这些错误文件夹),但也许您可以通过删除并重新安装certbot-auto软件包来解决问题。

(你的Debian版本非常古老,但是certbot版本不是,并且它使用virtualenv作为其依赖项,所以它可能不是那样。)

© www.soinside.com 2019 - 2024. All rights reserved.