pip install 代理源设置

2019-08-07  本文已影响0人  snowpigppp

更改pip install的代理源,提高下载速度。
国内的一些代理源:
阿里云 :http://mirrors.aliyun.com/pypi/simple/
中国科学技术大学:https://pypi.mirrors.ustc.edu.cn/simple/
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣:http://pypi.douban.com/simple/

长期修改

设置方法:

  1. cd ~ && mkdir .pip&&cd .pip
  2. touch pip.conf
  3. vi pip.conf
    写入
[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host=pypi.douban.com

临时使用:

可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple
例如:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gevent

这样就会从清华这边的镜像去安装gevent库。


注意,目前conda install已经不支持国内的代理源

上一篇 下一篇

猜你喜欢

热点阅读