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源。