天天看點

更新pip逾時問題解決

更新pip時用下面的指令更新不成功,如圖:

python -m pip install --upgrade pip

這個指令時都是time out ,如下情況:

更新pip逾時問題解決

解決方法,使用鏡像源,我這裡采用的是豆瓣鏡像源,

指令行:python -m pip install --upgrade pip -ihttp://pypi.douban.com/simple --trusted-host pypi.douban.com

更新pip逾時問題解決

更新成功,從pip-18.0變成了pip-19.3.1

更新pip逾時問題解決

安裝第三方包時,如若逾時,也可采用換源的方法

pip國内的一些鏡像

阿裡雲 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的時候在後面加上-i參數,指定pip源

eg: pip install scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple

繼續閱讀