Getting error while running certbot command

Is this issue related to python?

My domain is: http://132.145.97.206/

I ran this command: # certbot --version

It produced this output:

# certbot --version
Traceback (most recent call last):
  File "/bin/certbot", line 9, in <module>
    load_entry_point('certbot==1.0.0', 'console_scripts', 'certbot')()
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 378, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2566, in load_entry_point
    return ep.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/main.py", line 2, in <module>
    from certbot._internal import main as internal_main
  File "/usr/lib/python2.7/site-packages/certbot/_internal/main.py", line 20, in <module>
    from certbot._internal import client
  File "/usr/lib/python2.7/site-packages/certbot/_internal/client.py", line 14, in <module>
    from acme import client as acme_client
  File "/usr/lib/python2.7/site-packages/acme/client.py", line 40, in <module>
    urllib3.contrib.pyopenssl.inject_into_urllib3()
AttributeError: 'module' object has no attribute 'pyopenssl'

My web server is (include version):

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

[root@ora html]# uname -a
Linux ora-free 3.10.0-1062.9.1.el7.x86_64 #1 SMP Fri Dec 6 15:49:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
[root@ora html]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@ora html]#

My hosting provider, if applicable, is: Oracle

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): getting error

1 Like

It looks like the same dependency conflict reported here: https://github.com/certbot/certbot/issues/6328

How did you install Certbot? Did you install it from EPEL as suggested on https://certbot.eff.org/lets-encrypt/centosrhel7-other ?

What does this show:

rpm -q python-urllib3 pyOpenSSL
python -c "import urllib3; print urllib3.__version__"
1 Like

Thanks for the comment. Yes, I followed the instruction. I will try to reinstall everything and see if it is working.

rpm -q python-urllib3 pyOpenSSL
python-urllib3-1.10.2-7.el7.noarch
pyOpenSSL-0.13.1-4.el7.x86_64

 python -c "import urlllib3; print urllib3.__version__"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named urlllib3
1 Like

Sorry, I put one too many l’s there. Could you try it again without the extra one? I edited the earlier post.

1 Like

I was able to resolve the issue by uninstalling the packages and then re-installing. python-urllib3 was giving problem while installing. So I did below things

1. Uninstall urllib3
2. Again install python-urllib3

pip uninstall urllib3
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Found existing installation: urllib3 1.25.7
Uninstalling urllib3-1.25.7:
  Would remove:
    /usr/lib/python2.7/site-packages/urllib3-1.25.7.dist-info/*
    /usr/lib/python2.7/site-packages/urllib3/*
  Would not remove (might be manually added):
    /usr/lib/python2.7/site-packages/urllib3/packages/ordered_dict.py
Proceed (y/n)? y
  Successfully uninstalled urllib3-1.25.7

 yum install python-urllib3.noarch 0:1.10.2-7.el7

1 Like

I did the uninstall/reinstall but now I get this error …

pkg_resources.DistributionNotFound: The ‘urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1’ distribution was not found and is required by requests

1 Like

Was your installation successful?

1 Like

There were no errors when I reinstalled using the commands above.

The output from this command follows …
python -c ‘import certbot, requests, urllib3, OpenSSL; print(“certbot :”, certbot.version); print("requests: ", requests.version); print(“urllib3 :”, urllib3.version); print(“OpenSSL :”, OpenSSL.version)’
(‘certbot :’, ‘1.0.0’)
('requests: ', ‘2.6.0’)
(‘urllib3 :’, ‘1.10.2’)
(‘OpenSSL :’, ‘0.13.1’)

1 Like

My install was messed up because some things were installed with yum, others were installed with pip install and some were installed both ways. Got it to work by uninstalling those items and reinstalling certbot and it’s dependencies just using yum, urllib3 version 1.10.2.

2 Likes

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