想要安裝requests庫結果,我更新pip一直不成功
uj5u.com熱心網友回復:
我已管理員更新了pip結果還是安裝不了requestsuj5u.com熱心網友回復:
這個是網路連接問題,換個鏡像源就可以了uj5u.com熱心網友回復:
https://blog.csdn.net/ArkGod/article/details/81044462這篇文章應該能幫你uj5u.com熱心網友回復:
你需要:學習如何解決問題此處問題現象是:
ReadTimeoutError HTTPSConnectionPool ...
意思是:網路超時了
-》而不是你以為的 權限 問題
-》所以:換 管理員呢 當然沒用
-》所以解決思路是:想辦法不超時
實作辦法:
1. 科學上網后,加上代理 -》 就可以正常下載 不超時了
如果不會,可以考慮參考:
科學上網相關知識總結
特點:有點麻煩,但是一勞永逸,且以后也用得到(比如上google搜技術資料等)
2.更換源
即 pip下載的庫的地址 不用官網默認的,改為 國內的一些服務器
-》這樣連接就快了 就不會有超時問題了
如何換源?
參考別人說的
https://blog.csdn.net/ArkGod/article/details/81044462
windows中,給當前用戶根目錄
往往是:
C:\Users\Administrator\
或者換成你自己的 C:\Users\YourUserName\
然后(如果沒有就新建)編輯 pip.ini
內容是:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
或:
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn
其中index-url的值,也可以換成其他的,比如:
阿里云的:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
以及其他的:
豆瓣:http://pypi.douban.com
相關參考:
【已解決】Mac中給pip更換源以加速下載
uj5u.com熱心網友回復:
pip install ***** -i https://pypi.tuna.tsinghua.edu.cn/simple****填寫你要裝入的包
uj5u.com熱心網友回復:
python -m pip install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simplepython -m pip install --upgrade pip --user -i https://pypi.tuna.tsinghua.edu.cn/simple
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/78157.html
上一篇:Python小白在線求救
下一篇:python中字串轉換成數字出錯
