如何解决ImportError:'pyOpenSSL'modulemissingrequiredfunctionality的问题-古蔺大橙子建站
RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
如何解决ImportError:'pyOpenSSL'modulemissingrequiredfunctionality的问题

这篇文章主要讲解了“如何解决ImportError: 'pyOpenSSL' module missing required functionality的问题”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“如何解决ImportError: 'pyOpenSSL' module missing required functionality的问题”吧!

沁源网站制作公司哪家好,找创新互联建站!从网页设计、网站建设、微信开发、APP开发、响应式网站设计等网站项目制作,到程序开发,运营维护。创新互联建站于2013年创立到现在10年的时间,我们拥有了丰富的建站经验和运维经验,来保证我们的工作的顺利进行。专注于网站建设就选创新互联建站

问题描述

执行 certbot renew 产生如下错误:

# certbot renew --renew-hook "docker-compose -f /usr/local/harbor/docker-compose.yml restart"
/usr/lib/python2.7/site-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
************************************************************
You are running Setuptools on Python 2, which is no longer
supported and
>>> SETUPTOOLS WILL STOP WORKING <<<
in a subsequent release (no sooner than 2020-04-20).
Please ensure you are installing
Setuptools using pip 9.x or later or pin to `setuptools<45`
in your environment.
If you have done those things and are still encountering
this message, please comment in
https://github.com/pypa/setuptools/issues/1458
about the steps that led to this unsupported combination.
************************************************************
  sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)
Traceback (most recent call last):
  File "/usr/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 490, 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 2859, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2450, in load
    return self.resolve()
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2456, 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 37, in 
    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 160, in _validate_dependencies_met
    "'pyOpenSSL' module missing required functionality. "
ImportError: 'pyOpenSSL' module missing required functionality. Try upgrading to v0.14 or newer.

问题原因

在 CenOS 中,或者其他发行版,我们可以通过 pip 安装 Python 模块,也可以使用 yum 源安装 Python 模块。

也就说,问题可能有两种原因:
1)同个包即通过 yum 安装,也通过 pip 安装,最后导致冲突
2)或者某个模块依赖于更新版本的 pyOpenSSL 模块

从日志中看,可能是 urllib3 模块的问题。

解决办法

下面是原文作者给出的解决方案,能够解决我们的问题:

pip uninstall -y requests
yum reinstall -y python-requests
pip uninstall -y six
yum reinstall -y python-six
pip uninstall -y urllib3
yum reinstall -y python-urllib3

感谢各位的阅读,以上就是“如何解决ImportError: 'pyOpenSSL' module missing required functionality的问题”的内容了,经过本文的学习后,相信大家对如何解决ImportError: 'pyOpenSSL' module missing required functionality的问题这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是创新互联,小编将为大家推送更多相关知识点的文章,欢迎关注!


网页标题:如何解决ImportError:'pyOpenSSL'modulemissingrequiredfunctionality的问题
网站链接:http://scgulin.cn/article/gscihh.html