Python "SSLError("SSL 모듈을 사용할 수 없기 때문에 HTTPS URL에 연결할 수 없습니다.")': /simple/docutils/"

Python "SSLError("SSL 모듈을 사용할 수 없기 때문에 HTTPS URL에 연결할 수 없습니다.")': /simple/docutils/"

질문

  • pip(macOS 10.12)를 사용하여 터미널에서 무엇을 설치하려고 해도 이 오류 메시지가 나타납니다.
  • 설치하고 완전히 제거했을 수도 있습니다.집에서 만든이전에는 이 문제를 해결하는 방법을 모르겠습니다.

내가 실행해본 설치(모든 경우에 동일한 오류 메시지)

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

시도된 솔루션

답변1

https://stackoverflow.com/a/29969862/10270590

virtualenv 디렉터리로 변경합니다(단, workon을 실행하지 않음).

cd ~/.virtualenv/name_of_broken_venv

이제 다음 파일을 삭제하세요.

rm -rf .Python bin/python* lib/python2.7/* include/python2.7

그런 다음 Venv를 다시 빌드하고 다음을 실행하십시오.

virtualenv .
pip install -r requirements.txt

관련 정보