Encountering 'module' object has no attribute 'pyopenssl' when running Cerbot

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:I have a lot of domains.But none of them is asked to provide when I was following the instruction.Here is one of them: china-ruiyi.com

I ran this command:certbot --nginx (I’m root user)

It produced this output:
Traceback (most recent call last):
File “/bin/certbot”, line 9, in
load_entry_point(‘certbot==1.0.0’, ‘console_scripts’, ‘certbot’)()
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 2852, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 2443, in load
return self.resolve()
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 2449, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/usr/lib/python2.7/site-packages/certbot/main.py”, line 2, in
from certbot._internal import main as internal_main
File “/usr/lib/python2.7/site-packages/certbot/_internal/main.py”, line 20, in
from certbot._internal import client
File “/usr/lib/python2.7/site-packages/certbot/_internal/client.py”, line 14, in
from acme import client as acme_client
File “/usr/lib/python2.7/site-packages/acme/client.py”, line 40, in
urllib3.contrib.pyopenssl.inject_into_urllib3()
AttributeError: ‘module’ object has no attribute ‘pyopenssl’

My web server is (include version):Nginx 1.16.1

The operating system my web server runs on is (include version):
CentOS 7.7 Enterprise (Google Cloud Platform provided)
My hosting provider, if applicable, is:
Google
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):
yes. BTpanel 7.1(latest version,developed by a China company. In Chinese,宝塔Linux面板 )
The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):
Traceback (most recent call last):
File “/bin/certbot”, line 9, in
load_entry_point(‘certbot==1.0.0’, ‘console_scripts’, ‘certbot’)()
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 489, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 2852, in load_entry_point
return ep.load()
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 2443, in load
return self.resolve()
File “/usr/lib/python2.7/site-packages/pkg_resources/init.py”, line 2449, in resolve
module = import(self.module_name, fromlist=[‘name’], level=0)
File “/usr/lib/python2.7/site-packages/certbot/main.py”, line 2, in
from certbot._internal import main as internal_main
File “/usr/lib/python2.7/site-packages/certbot/_internal/main.py”, line 20, in
from certbot._internal import client
File “/usr/lib/python2.7/site-packages/certbot/_internal/client.py”, line 14, in
from acme import client as acme_client
File “/usr/lib/python2.7/site-packages/acme/client.py”, line 40, in
urllib3.contrib.pyopenssl.inject_into_urllib3()
AttributeError: ‘module’ object has no attribute ‘pyopenssl’

Hmm…An error.

1 Like

I’ve tried the solutions that first and the second discussions (google “AttributeError: ‘module’ object has no attribute ‘pyopenssl’”)had provided.So my “request version” is 2.6.0 already.

1 Like

What’s the output for pip show pyOpenSSL?

1 Like

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
Name: pyOpenSSL
Version: 0.13.1
Summary: Python wrapper module around the OpenSSL library
Home-page: http://pyopenssl.sourceforge.net/
Author: Jean-Paul Calderone
Author-email: exarkun@twistedmatrix.com
License: APL2
Location: /usr/lib64/python2.7/site-packages
Requires:
Required-by: ndg-httpsclient, josepy, certbot-nginx, acme

1 Like

How did you install certbot?
宝塔面板自带Let’s Encrypt证书申请,请问为什么使用certbot呢?

1 Like

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