Python “SSLError(”无法连接到 HTTPS URL 因为 SSL 模块不可用。“)': /simple/docutils/”
Python “SSLError(”Can't connect to HTTPS URL because the SSL module is not available.“)': /simple/docutils/”
问题
- 无论我尝试使用 pip 从终端安装什么,我都会收到此错误消息
- 我可能已经安装并完全删除了 homebrew (macOS 10.12) 但我不确定如何解决这个问题
- Django 3.0 应用程序运行非常好
安装我尝试 运行(所有情况下都出现相同的错误消息)
pip install -r requirements.txt
pip install django-storages
pip install ssl
错误信息
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/django-storages/
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/django-storages/
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/django-storages/
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/django-storages/
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/django-storages/
Could not fetch URL https://pypi.org/simple/django-storages/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/django-storages/ (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 django-storages (from versions: none)
ERROR: No matching distribution found for django-storages
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
尝试过的解决方案
- pip TLS/SSL, however the ssl module in Python is not available problem
- pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available
- @hoefling https://whosebug.com/users/2650249/hoefling 推荐给 运行:
python -c "import _ssl"
- 结果:
dyld: Library not loaded: @executable_path/../.Python
Referenced from: /Users/..../django_app_mainfolder/ven/bin/python
Reason: image not found
Abort trap: 6
- 推荐解决方案:Broken references in Virtualenvs
- 我正在看这里的主要答案,但我不知道发生了什么 = This is the origin of the answer
- 无效 -
- 不可用 - 我现在不使用 brew -
转到您的 virtualenv 目录(但不要 运行 工作):
cd ~/.virtualenv/name_of_broken_venv
现在删除这些文件:
rm -rf .Python bin/python* lib/python2.7/* include/python2.7
然后重建你的 venv,运行:
virtualenv .
pip install -r requirements.txt
问题
- 无论我尝试使用 pip 从终端安装什么,我都会收到此错误消息
- 我可能已经安装并完全删除了 homebrew (macOS 10.12) 但我不确定如何解决这个问题
- Django 3.0 应用程序运行非常好
安装我尝试 运行(所有情况下都出现相同的错误消息)
pip install -r requirements.txt
pip install django-storages
pip install ssl
错误信息
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/django-storages/
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/django-storages/
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/django-storages/
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/django-storages/
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/django-storages/
Could not fetch URL https://pypi.org/simple/django-storages/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/django-storages/ (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 django-storages (from versions: none)
ERROR: No matching distribution found for django-storages
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
尝试过的解决方案
- pip TLS/SSL, however the ssl module in Python is not available problem
- pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available
- @hoefling https://whosebug.com/users/2650249/hoefling 推荐给 运行:
python -c "import _ssl"
- 结果:
dyld: Library not loaded: @executable_path/../.Python Referenced from: /Users/..../django_app_mainfolder/ven/bin/python Reason: image not found Abort trap: 6
- 推荐解决方案:Broken references in Virtualenvs
- 我正在看这里的主要答案,但我不知道发生了什么 = This is the origin of the answer
- 无效 -
- 不可用 - 我现在不使用 brew -
- 结果:
转到您的 virtualenv 目录(但不要 运行 工作):
cd ~/.virtualenv/name_of_broken_venv
现在删除这些文件:
rm -rf .Python bin/python* lib/python2.7/* include/python2.7
然后重建你的 venv,运行:
virtualenv .
pip install -r requirements.txt