Certbot was installed correctly on Debian (oldstable-updates) and works just fine in generating SSL certificates for the hosted websites.
But after hosting a new website (flask app with Gunicorn), certbot commands started throwing the error "ModuleNotFoundError: No module named '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.
first I ran
Then
this would fix broken python in the system; afterwards, certbot worked just fine.