Debian Stretch 上的 Letsencrypt/certbot:ImportError:无法导入名称 jose

Debian Stretch 上的 Letsencrypt/certbot:ImportError:无法导入名称 jose

在安装并使用 Debian 软件包(版本 0.10.2)提供的 certbot 脚本后,我收到了提供通配符证书的请求。由于 Debian repo 中的 certbot 版本无法提供通配符证书,因此我升级了 certbot。

最具 Python 风格的方式似乎是使用 pip 进行升级:

pip install certbot --upgrade

升级后,certbot 因版本冲突而停止工作。我猜是这一行

load_entry_point('certbot==0.10.2', 'console_scripts', 'certbot')()

防止

/usr/bin/certbot

脚本前端使用较新的 certbot python 包版本运行。现在,我几乎回到了运行原始 Debian 版本,但这个问题仍然存在:

  File "/usr/bin/certbot", line 11, in <module>
    load_entry_point('certbot==0.10.2', 'console_scripts', 'certbot')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2707, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2325, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2331, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/certbot/main.py", line 13, in <module>
    from acme import jose

据我所知(到目前为止我还不是 Python 专家),该acme软件包已安装:

root@cloud:~# pip show acme
Name: acme
Version: 0.26.1
Summary: ACME protocol implementation in Python
Home-page: https://github.com/letsencrypt/letsencrypt
Author: Certbot Project
Author-email: [email protected]
License: Apache License 2.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: cryptography, six, pytz, PyOpenSSL, pyrfc3339, setuptools, requests, josepy, requests-toolbelt, mock

我可以通过创建一个小测试脚本并运行它来获得相同的错误消息

from acme import jose

内容如下:

root@cloud:~# python test.py
Traceback (most recent call last):
  File "test.py", line 1, in <module>
    from acme import jose
ImportError: cannot import name jose

在深入研究 Python 包管理之前,我希望得到帮助。

相关内容