環境
- windows10
- Python3.7.3
- pip19.0.3
問題
Python初心者ながら見様見真似でAWSを操作したくてboto3を落とそうとしたら
pip install boto3出来ない。
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting boto3
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/boto3/
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/boto3/
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/boto3/
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/boto3/
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/boto3/
Could not fetch URL https://pypi.org/simple/boto3/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/boto3/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
Could not find a version that satisfies the requirement boto3 (from versions: )
No matching distribution found for boto3
解決策候補
Typo?
証明書のエラー?
エラーをググるとどうも証明書の関係によって信用していないからのような記事が出てきたので実行した。
https://qiita.com/agajo/items/73d6f14855da703972e0
しかしうまくいかない。
解決策
公式サイトのpipのページを見ると
複数のバージョンの Python がインストールされている環境では、どの Python の実行環境にパッケージをインストールするか、指定する必要があります。
とある。そういえば別のシステムの関係で2.xを入れていたことを思い出してバージョン指定をして実行
py -3 -m pip install boto3
無事解決