web-dev-qa-db-ja.com

Python "SSLError(" SSLモジュールが利用できないためHTTPS URLに接続できません。 ") ':/ simple / docutils /"

[〜#〜]問題[〜#〜]

  • 端末からpip(macOS 10.12)でインストールしようとすると、このエラーメッセージが表示されます
  • 以前にインストールして完全に削除した可能性がありますhomebrewこれを解決する方法がわかりません

実行しようとするインストール(すべてのケースで同じエラーメッセージ)

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
sogu

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

virtualenvディレクトリに移動します(ただし、workonは実行しないでください)。

cd ~/.virtualenv/name_of_broken_venv

これらのファイルを削除します。

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

次に、envを再構築するには、次のコマンドを実行します。

virtualenv .
pip install -r requirements.txt
0
sogu