美文网首页
pip install 代理源设置

pip install 代理源设置

作者: snowpigppp | 来源:发表于2019-08-07 10:29 被阅读0次

更改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已经不支持国内的代理源

相关文章

网友评论

      本文标题:pip install 代理源设置

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