pip install 代理源设置

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

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容