0

这更像是一个解决方案而不是一个问题。我没有发现 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
4

1 回答 1

0

通过安装 compat-openssl10 库修复它

 yum install compat-openssl10-1:1.0.2o-3.el8.x86_64
于 2021-09-07T19:19:03.560 回答