美文网首页
ubuntu16.04下配置pip国内镜像源加速

ubuntu16.04下配置pip国内镜像源加速

作者: 秘果_li | 来源:发表于2019-01-10 21:45 被阅读0次

原文链接 https://blog.csdn.net/yucicheung/article/details/79095742

国内镜像源列表
豆瓣(douban) http://pypi.douban.com/simple/
清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/ (推荐)
阿里云 http://mirrors.aliyun.com/pypi/simple/
中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/
中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/


安装tensorflow时,使用默认方式安装速度在8~13kb/s (龟速)
原文推荐的豆瓣镜像源在我电脑上加速不是很明显
改换清华的镜像 install 速度在几百kb/s到1M/s左右,亲测速度提升快

永久置换pip镜像源

  1. 创建pip.conf文件
    运行以下命令:
cd ~/.pip
  1. 如果提示目录不存在的话,我们要自行创建一个,再进入目录
mkdir ~/.pip
cd ~/.pip
  1. 在.pip目录下创建一个pip.conf文件
touch pip.conf

文件就创建好了(当然如果你已经有这个文件了这步可以跳过).

  1. 编辑pip.conf文件
sudo gedit ~/.pip/pip.conf

打开pip.conf文件窗口,将以下内容复制到文件中:

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

这样就替换成功了

安装成果,几分钟搞定

Successfully installed bleach-1.5.0 
html5lib-0.9999999 
markdown-3.0.1 
numpy-1.15.4 
protobuf-3.6.1 
tensorflow-gpu-1.3.0 
tensorflow-tensorboard-0.1.8 
werkzeug-0.14.1

相关文章

网友评论

      本文标题:ubuntu16.04下配置pip国内镜像源加速

      本文链接:https://www.haomeiwen.com/subject/fgyzrqtx.html