Posted at

CentOS7に入れたLet's EncryptでImportError

CentOS7でLet's Encryptを利用しているサーバで下記エラーになりました。

どうもAWS コマンドラインインターフェイスを導入すると、Let's Encryptとpythonがバッティングして

下記のようなエラーを出してそう。


エラー

Traceback (most recent call last):

File "/bin/certbot", line 9, in <module>
load_entry_point('certbot==0.27.1', '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 21, in <module>
from certbot import client
File "/usr/lib/python2.7/site-packages/certbot/client.py", line 16, in <module>
from acme import client as acme_client
File "/usr/lib/python2.7/site-packages/acme/client.py", line 36, in <module>
requests.packages.urllib3.contrib.pyopenssl.inject_into_urllib3() # type: ignore
File "/usr/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 118, in inject_into_urllib3
_validate_dependencies_met()
File "/usr/lib/python2.7/site-packages/urllib3/contrib/pyopenssl.py", line 153, in _validate_dependencies_met
raise ImportError("'pyOpenSSL' module missing required functionality. "
ImportError: 'pyOpenSSL' module missing required functionality. Try upgrading to v0.14 or newer.


対応

# pip install --upgrade pip

# pip install requests --ignore-installed
# pip install --upgrade --force-reinstall 'requests==2.6.0'


情報源

https://github.com/certbot/certbot/issues/5534#issuecomment-364549029

https://qiita.com/morohoshi/items/05949674e000402c253c