方式1: 每次指定

目前用 pip 安装软件时有时候软件包的源位于境外,所以导致安装速度很慢,建议使用国内的一些镜像源进行安装:

阿里云:
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/

例如, 用阿里云的源安装 tensorflow-gpu:

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

 

方式2, 全局设置

 

 修改默认镜像源
 pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

 

posted on 2019-11-06 22:26  lshan  阅读(140)  评论(0编辑  收藏  举报