【问题标题】:RHEL 8: WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not availableRHEL 8:警告:pip 配置了需要 TLS/SSL 的位置,但是 Python 中的 ssl 模块不可用
【发布时间】:2021-11-04 15:58:07
【问题描述】:

这更像是一个解决方案而不是一个问题。我没有发现 Stackoverflow 上的任何解决方案都适合我。 我正在使用 RHEL 8,但我突然无法 pip 安装(使用 pip3.6)。 错误看起来像:

WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/galpy/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/galpy/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/galpy/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/galpy/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)': /simple/galpy/
Could not fetch URL https://pypi.org/simple/galpy/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/galpy/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
ERROR: Could not find a version that satisfies the requirement galpy (from versions: none)
ERROR: No matching distribution found for galpy
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.

我终于通过进入 Python 并在 ssl 模块上进行导入来解决这个问题:

    Python 3.6.8 (default, Feb  5 2019, 14:27:57) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl  
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/ssl.py", line 101, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: libssl.so.10: cannot open shared object file: No such file or directory

【问题讨论】:

    标签: openssl python-3.6 rhel8


    【解决方案1】:

    通过安装 compat-openssl10 库修复它

     yum install compat-openssl10-1:1.0.2o-3.el8.x86_64
    

    【讨论】:

      猜你喜欢
      • 2021-07-27
      • 2020-10-30
      • 2023-01-20
      • 2021-07-28
      • 2019-06-21
      • 2021-11-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多