LoginSignup
3
1

More than 3 years have passed since last update.

Python学習ノート_問題の解決_001

Posted at

pipが実行時にエラーについて

  • pipで直接使えない場合があります。(外部サイトへのアクセス制限あり)
    下記のようにパッケージをインストール時にはエラーになる解決方法はproxyサーバー経由でアクセスする
エラー内容_01.txt
 'Connection to pypi.org timed out. (connect timeout=15)'
pipコマンド_01.txt
修正前:
pip install <PACKAGE_NAME>
修正後:
pip install <PACKAGE_NAME> --proxy http://<PROXY_URL>:<PORT_NO>
  • 上記の方法でも解決できない時もあります。
    下記のようなssh認証のエラーが発生したら、pipのパラメーターに「--trusted-host pypi.org --trusted-host files.pythonhosted.org」を追加することで解決できます。
エラー内容_02.txt
Could not fetch URL https://pypi.org/simple/ibm-db/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url:
/simple/ibm-db/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:1108)'))
) - skipping
修正前:
pip install <PACKAGE_NAME> --proxy http://<PROXY_URL>:<PORT_NO>
修正後:
pip install <PACKAGE_NAME> --trusted-host pypi.org --trusted-host files.pythonhosted.org --proxy http://<PROXY_URL>:<PORT_NO>
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1