pipインストール時にエラーRetrying(Retry(total=4,connect=None,read=None,redirect=None))after connection broken

1025 ワード

今日pipを使用してクイックインストールスクリプトを実行すると、次の問題が発生します.
[root@localhost install]# pip install -r requirements.txt 
You are using pip version 7.1.0, however version 20.2.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting django==1.6 (from -r requirements.txt (line 1))
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ProtocolError('Connection aborted.', error(101, 'Network is unreachable'))': /packages/f1/dd/271a9fa17b95a980ac66c44848fef72d29d904d3e141b219f6e91d1904ec/Django-1.6-py2.py3-none-any.whl


エラーの原因は、ダウンロードインストール接続の海外ミラーソースがタイムアウトしたため、国内のソースに変更されました.
   :http://mirrors.aliyun.com/pypi/simple/

アリクラウドソースでインストーラを実行
pip install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

ここのrequirements.txtはインストールを実行するスクリプトです.–trusted-hostの後にhostを表します.アリクラウドのドメイン名と同じです.