英文:
certbot cannot import name 'appengine' from 'urllib3.contrib'
问题
在我的Ubuntu 22.04.2 LTS上,使用Python 3.10.6,Certbot出现以下错误:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 48, in <module>
from requests.packages.urllib3.contrib import appengine as gaecontrib
ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (/usr/local/lib/python3.10/dist-packages/urllib3/contrib/__init__.py)
带有完整错误消息的情况下:
在处理上述异常时,发生了另一个异常:
Traceback (most recent call last):
File "/usr/bin/certbot", line 33, in <module>
sys.exit(load_entry_point('certbot==1.21.0', 'console_scripts', 'certbot')())
File "/usr/bin/certbot", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/certbot/main.py", line 2, in <module>
from certbot._internal import main as internal_main
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 28, in <module>
from certbot._internal import account
File "/usr/lib/python3/dist-packages/certbot/_internal/account.py", line 19, in <module>
from acme.client import ClientBase # pylint: disable=unused-import
File "/usr/lib/python3/dist-packages/acme/client.py", line 34, in <module>
from requests_toolbelt.adapters.source import SourceAddressAdapter
File "/usr/lib/python3/dist-packages/requests_toolbelt/__init__.py", line 12, in <module>
from .adapters import SSLAdapter, SourceAddressAdapter
File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/__init__.py", line 12, in <module>
from .ssl import SSLAdapter
File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/ssl.py", line 16, in <module>
from .._compat import poolmanager
File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 50, in <module>
from urllib3.contrib import appengine as gaecontrib
ImportError: cannot import name 'appengine' from 'urllib3.contrib' (/usr/local/lib/python3.10/dist-packages/urllib3/contrib/__init__.py)
这是一堆错误,我不知道从哪里开始解决。希望能提供一点帮助!
英文:
On my Ubuntu 22.04.2 LTS with Python 3.10.6, Certbot gives the following error:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 48, in <module>
from requests.packages.urllib3.contrib import appengine as gaecontrib
ImportError: cannot import name 'appengine' from 'requests.packages.urllib3.contrib' (/usr/local/lib/python3.10/dist-packages/urllib3/contrib/__init__.py)
with the complete error message:
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/certbot", line 33, in <module>
sys.exit(load_entry_point('certbot==1.21.0', 'console_scripts', 'certbot')())
File "/usr/bin/certbot", line 25, in importlib_load_entry_point
return next(matches).load()
File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load
module = import_module(match.group('module'))
File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/certbot/main.py", line 2, in <module>
from certbot._internal import main as internal_main
File "/usr/lib/python3/dist-packages/certbot/_internal/main.py", line 28, in <module>
from certbot._internal import account
File "/usr/lib/python3/dist-packages/certbot/_internal/account.py", line 19, in <module>
from acme.client import ClientBase # pylint: disable=unused-import
File "/usr/lib/python3/dist-packages/acme/client.py", line 34, in <module>
from requests_toolbelt.adapters.source import SourceAddressAdapter
File "/usr/lib/python3/dist-packages/requests_toolbelt/__init__.py", line 12, in <module>
from .adapters import SSLAdapter, SourceAddressAdapter
File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/__init__.py", line 12, in <module>
from .ssl import SSLAdapter
File "/usr/lib/python3/dist-packages/requests_toolbelt/adapters/ssl.py", line 16, in <module>
from .._compat import poolmanager
File "/usr/lib/python3/dist-packages/requests_toolbelt/_compat.py", line 50, in <module>
from urllib3.contrib import appengine as gaecontrib
ImportError: cannot import name 'appengine' from 'urllib3.contrib' (/usr/local/lib/python3.10/dist-packages/urllib3/contrib/__init__.py)
It's kind of a lot errors and I don't know where to start to resolve it.
I little help would be appreciated!
答案1
得分: 1
urllib3被apt和pip都安装了。我通过以下命令删除了pip版本:
pip3 uninstall urllib3
现在certbot正常工作。
英文:
urllib3 was installed by both apt and pip. I removed the pip version by issuing:
pip3 uninstall urllib3
Now certbot work fine.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论