更換python依賴包的下載路徑


1、國內鏡像

阿里雲:
https://mirrors.aliyun.com/pypi/simple/

豆瓣網:
http://pypi.douban.com/simple/

清華大學:
https://pypi.tuna.tsinghua.edu.cn/simple/

中國科技大學 :
https://pypi.mirrors.ustc.edu.cn/simple/

2、臨時更換鏡像:加-i選項

pip install tensorflow-gpu -i https://mirrors.aliyun.com/pypi/simple/

3、永久更換鏡像

1> windows下:

在 “C:\Users\自己的用戶名” 文件夾下,添加pip文件夾,文件夾內新建pip.ini文件,內容為:

[global]

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

2> 在linux系統中更新pip源的方式

a. 在用戶的家目錄下面創建名為  .pip文件夾

b. 在創建好的 .pip文件夾中創建名為 pip.conf的文件

c. 在pip.conf文件中輸入以下內容。

[global]
timeout = 6000
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com

注意:新版ubuntu要求使用https源。


免責聲明!

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



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