简体   繁体   English

Certbot 在 Linux 中返回“No module named 'six'”错误

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

Certbot was installed correctly on Debian (oldstable-updates) and works just fine in generating SSL certificates for the hosted websites. Certbot 已正确安装在 Debian (oldstable-updates) 上,并且在为托管网站生成 SSL 证书方面运行良好。

But after hosting a new website (flask app with Gunicorn), certbot commands started throwing the error "ModuleNotFoundError: No module named 'six'".但是在托管一个新网站(带有 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:~$

Why did it break and how can I fix it?为什么它坏了,我该如何修复它?

I finally found the solution with help of LetsEncrypt forum.我终于在 LetsEncrypt 论坛的帮助下找到了解决方案。

first I ran首先我跑了

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

Then然后

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

this would fix broken python in the system;这将修复系统中损坏的python; afterwards, certbot worked just fine.之后,certbot 工作得很好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM