pip 下載時出現問題TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'


我這里解決就是更新下載源,馬德,中科的源居然不夠快,我就只能換源了,一換就成功了

1.一次性(臨時使用):

可以在使用pip的時候加參數-i https://pypi.tuna.tsinghua.edu.cn/simple

例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple  --upgrade pip(其他包名也可以),這樣就會從清華這邊的鏡像去更新庫。

2.永久性

我機器找不到這個目錄,有點騷,我就用的一次性的

linux下,修改 ~/.pip/pip.conf (沒有就創建一個), 修改 index-url至tuna,內容如下:

 [global]
 index-url = https://pypi.tuna.tsinghua.edu.cn/simple

 

windows下,直接在user目錄中創建一個pip目錄,如:C:\Users\xx\pip,新建文件pip.ini,內容如下

 

 [global]
 index-url = https://pypi.tuna.tsinghua.edu.cn/simple


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM