pipインストールタイムアウトの問題の解決

1033 ワード

pipを使用してpythonライブラリをインストールすると、タイムアウトしてダウンロードできない問題がよく発生します.解決策は次のとおりです.
一、まず下のフォルダの下にpipフォルダを作成する
C:\Users\Administrator\AppData\Roaming
次にpipフォルダの下に新しいファイルpipを作成します.ini、内容:
[global] timeout = 60000 index-url = https://pypi.tuna.tsinghua.edu.cn/simple [install] use-mirrors = true mirrors = https://pypi.tuna.tsinghua.edu.cn
これでpipのインストールソースを国内に変更して、速度はとても速いです
 
二、国内ソースを一度に使用できる
1,タイムアウト時間の設定:pip--default-timeout=100 install Pillow,
2,キャッシュを使用しない:pip--no-cache-dir install Pillow
2、使用国内源:pip install web.py -i http://pypi.douban.com/simple --trusted-host pypi.douban.comアリ雲http://mirrors.aliyun.com/pypi/simple/中国科学技術大学https://pypi.mirrors.ustc.edu.cn/simple/豆弁(douban)http://pypi.douban.com/simple/清華大学https://pypi.tuna.tsinghua.edu.cn/simple/中国科学技術大学http://pypi.mirrors.ustc.edu.cn/simple/
例:以下の方法でダウンロード速度を大幅に改善
pip install -i https://pypi.doubanio.com/simple/   

 
 
参考と感謝:https://blog.csdn.net/darkfour/article/details/78191979