Error cannot import name constants when run command certbot version

Hello, today I try run command certbot --version, but I got this error. I don’t know why it happen. Please help me fix that, when I run certbot renew, the issue still happen.

My domain is:

I ran this command: certbot --version

It produced this output:

ImportError: cannot import name constants
Please see the logfile ‘/tmp/tmpHAhDoG/log’ for more details.

020-04-02 14:08:57,449:DEBUG:certbot._internal.log:Exiting abnormally:
Traceback (most recent call last):
File "/usr/bin/certbot", line 9, in <module>
load_entry_point('certbot==1.3.0', 'console_scripts', 'certbot')()
File "/usr/lib/python2.7/site-packages/certbot/main.py", line 15, in main
return internal_main.main(cli_args)
File "/usr/lib/python2.7/site-packages/certbot/_internal/main.py", line 1317, in main
plugins = plugins_disco.PluginsRegistry.find_all()
File "/usr/lib/python2.7/site-packages/certbot/_internal/plugins/disco.py", line 210, in 
find_all
plugin_ep = PluginEntryPoint(entry_point)
File "/usr/lib/python2.7/site-packages/certbot/_internal/plugins/disco.py", line 54, in 
__init__
self.plugin_cls = entry_point.load()
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2260, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/site-packages/certbot_nginx/configurator.py", line 20, in 
<module>
from certbot import constants as core_constants
ImportError: cannot import name constants
2020-04-02 14:08:57,449:ERROR:certbot._internal.log:An unexpected error occurred:

My web server is (include version): nginx 1.16.1

The operating system my web server runs on is (include version): centos 7

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know): yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel): no

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot): I can’t log it because this error

How did you install certbot?

Hello, I installed certbot lot of months ago, I’m not remember sure how to install it. But, I remember when I run command certbot renew before, it worked normally.

I tried install certbot again and everything works fine now.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.