Python Certbot 模块'collections'没有属性'Mapping'



当我尝试在Linux Ubuntu Server 20.04.3 LTS的控制台中运行certbot时,我得到以下错误:

Traceback (most recent call last):
File "/usr/bin/certbot", line 11, in <module>
load_entry_point('certbot==0.40.0', 'console_scripts', 'certbot')()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2451, in resolve
module = __import__(self.module_name, fromlist=['__name__'], level=0)
File "/usr/lib/python3/dist-packages/certbot/main.py", line 18, in <module>
from certbot import cert_manager
File "/usr/lib/python3/dist-packages/certbot/cert_manager.py", line 15, in <module>
from certbot import ocsp
File "/usr/lib/python3/dist-packages/certbot/ocsp.py", line 25, in <module>
from certbot.storage import RenewableCert # pylint: disable=unused-import
File "/usr/lib/python3/dist-packages/certbot/storage.py", line 15, in <module>
from certbot import cli
File "/usr/lib/python3/dist-packages/certbot/cli.py", line 33, in <module>
from certbot.plugins import disco as plugins_disco
File "/usr/lib/python3/dist-packages/certbot/plugins/disco.py", line 183, in <module>
class PluginsRegistry(collections.Mapping):
AttributeError: module 'collections' has no attribute 'Mapping'

我已经在寻找解决方案,但没有找到。即使是有同样错误的帖子也无法解决我的问题。奇怪的是,它在大约两个月前就起了作用。

我正在运行Python 3.10。

在我的案例中,我编辑了文件/usr/bin/certbot,并将#!/usr/bin/python3更改为:#!/usr/bin/python3.8,因为Certbot还不支持Python 3.10

相关内容

  • 没有找到相关文章

最新更新