Python „SSLError(„Can’t connect to HTTPS URL because the SSL module is not available.”)’: /simple/docutils/” (Unix, Python, Ssl, Pip, Homebrew, Django)

sogu a intrebat.

PROBLEMĂ

  • Indiferent ce încerc să instalez din terminal cu pip (macOS 10.12), primesc acest mesaj de eroare
  • Este posibil să fi instalat și să fi șters complet homebrew înainte, dar nu sunt sigur cum să rezolv acest lucru

Instalările pe care încerc să le execut (în toate cazurile același mesaj de eroare)

pip install -r requirements.txt
pip install django-storages
pip install ssl

MESAJ DE ERROR

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

Soluții încercate

  • https://stackoverflow.com/a/59280089/10270590
  • https://stackoverflow.com/questions/53742171/pip-tls-ssl-however-the-ssl-module-in-python-is-not-available-problem
  • https://stackoverflow.com/questions/45954528/pip-is-configured-with-locations-that-require-tls-ssl-however-the-ssl-module-in/59280089#59280089

1 răspunsuri
sogu

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

mergeți în directorul virtualenv (dar nu rulați workon):

cd ~/.virtualenv/name_of_broken_venv

Acum ștergeți aceste fișiere:

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

Apoi, pentru a reconstrui venv-ul, rulați:

virtualenv .
pip install -r requirements.txt