簡體   English   中英

Certbot 在 Linux 中返回“No module named 'six'”錯誤

[英]Certbot returns "No module named 'six'" error in Linux

Certbot 已正確安裝在 Debian (oldstable-updates) 上,並且在為托管網站生成 SSL 證書方面運行良好。

但是在托管一個新網站(帶有 Gunicorn 的燒瓶應用程序)之后,certbot 命令開始拋出錯誤“ModuleNotFoundError:沒有名為‘six’的模塊”。

dev1n@azompr1:~$ apt-cache policy certbot | grep -i Installed
  Installed: 1.7.0-1


dev1n@azompr1:~$ sudo certbot delete
Traceback (most recent call last):
  File "/usr/bin/certbot", line 11, in <module>
    load_entry_point('certbot==1.7.0', 'console_scripts', 'certbot')()
  File "/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py", line 473, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py", line 2843, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py", line 2447, in load
    return self.resolve()
  File "/usr/local/lib/python3.8/dist-packages/pkg_resources/__init__.py", line 2453, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  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 9, in <module>
    import configobj
  File "/usr/lib/python3/dist-packages/configobj.py", line 22, in <module>
    import six
ModuleNotFoundError: No module named 'six'
dev1n@azompr1:~$

為什么它壞了,我該如何修復它?

我終於在 LetsEncrypt 論壇的幫助下找到了解決方案。

首先我跑了

sudo apt update && sudo apt install --reinstall python3-certbot python3-six

然后

sudo apt install --reinstall python3-acme python3-certifi python3-chardet python3-configargparse python3-configobj python3-cryptography python3-distro python3-future python3-idna python3-josepy python3-lib2to3 python3-minimal python3-openssl python3-parsedatetime python3-pkg-resources python3-requests python3-requests-toolbelt python3-rfc3339 python3-six python3-tz python3-urllib3 python3-zope.component python3-zope.event python3-zope.hookable python3-zope.interface

這將修復系統中損壞的python; 之后,certbot 工作得很好。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM