首页 > 解决方案 > 警告:pip 配置了需要 TLS/SSL 的位置

问题描述

我已经尝试了这个问题的所有答案,但到目前为止,它们都没有奏效。每当我使用 pip 时,我都会得到:

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/pip/
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping
Requirement already up-to-date: pip in ./.virtualenvs/tensorflow/lib/python3.6/site-packages (20.0.2)
WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.",)) - skipping

几天前我安装了新的 Catalina OS (10.15.3)。如果我做:

(tensorflow) MBP-de-Hector-2:~ hectoresteban$ python -c "import ssl; print(ssl.OPENSSL_VERSION)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/Cellar/python/3.6.5_1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 101, in <module>
    import _ssl             # if we can't import it, let the error propagate
ImportError: dlopen(/Users/hectoresteban/.virtualenvs/tensorflow/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/hectoresteban/.virtualenvs/tensorflow/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so
  Reason: image not found

标签: python-3.xmacossslpipmacos-catalina

解决方案


推荐阅读