When I try to run cerbot, I have the following error :
[root@XXXXX certbot]# modules/bin/certbot
Traceback (most recent call last):
File "/opt/certbot/modules/bin/certbot", line 5, in
from certbot.main import main
File "/opt/certbot/modules/certbot/main.py", line 6, in
from certbot._internal import main as internal_main
File "/opt/certbot/modules/certbot/_internal/main.py", line 20, in
import zope.component
File "/opt/certbot/modules/zope/component/init.py", line 25, in
from zope.interface import Interface
ModuleNotFoundError: No module named 'zope.interface'
When I check for module I have :
[root@xxxxx certbot]# pip3.9 list
Package Version
I'm not that familiar with pip, but I don't recognise the "modules" directory? In my cases when using pip from within a virtual environment (which you should ALWAYS do when using pip IMO), all Python modules end up in e.g. ./lib/python3.8/site-packages/.. Is that "modules" thing a virtual environment?
The most likely cause for this (Certbot can't find zope.interface, but pip can) is that certbot and pip are being executed in different environments. One is likely using the normal system environment, and the other is being run from a virtualenv.
[root@xxxxx certbot]# pip3.9 list
I am not familiar with RHEL and how the prompts are structured, but this prompt suggests to me that you are not running in a virtual environment, which is the recommended/supported method. on every platform I've used, the prompt would have the virtual env name in parenthesis as a prefix. e.g.
(certbot_venv)[root@xxxxx certbot]# pip3.9 list
It is very possible that [root@xxxxx certbot] is how a venv is shown on your operating system, but I am not familiar with that.
While an experienced Python user should be able to debug this pretty quickly, there are so many potential causes and things to check that solving it on a forum will be fairly onerous.
Assuming this is a new installation, the easiest thing to do is to very carefully read the installation instructions and do a fresh installation from scratch.