解決Python的pip install下載請求超時time out問題

下載請求超時

這種情況會發生在所有系統上。如果您出現這種情況,可以有3種方法解決。

方法1.增加超時時間

輸入命令:

pip --default-timeout=100 install xx

方法2.不使用緩存

pip --no-cache-dir install xx

方法3.使用國內鏡像源

pip install xx -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




 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章