更换pip源

网上搜到的pip国内镜像大部分是豆瓣的

http://pypi.douban.com/simple/

但是根本不全,很多包没有

所以推荐清华大学的

https://pypi.tuna.tsinghua.edu.cn/simple

临时使用

可以在使用pip的时候加参数-i https://pypi.tuna.tsinghua.edu.cn/simple
例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple gevent,这样就会从清华这边的镜像去安装gevent库。

永久修改

Linux下,修改 ~/.pip/pip.conf (没有就创建一个), 修改 index-url至tuna,内容如下:

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

windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini,内容如下

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

转自 https://blog.csdn.net/tanzuozhev/article/details/76022189

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。