pip国内镜像(清华大学镜像)

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

http://pypi.douban.com/simple/
1
2
但是根本不全,很多包没有

所以推荐清华大学的

https://pypi.tuna.tsinghua.edu.cn/simple
1
临时使用
可以在使用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
1
2
windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini,内容如下

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

发布了10 篇原创文章 · 获赞 2 · 访问量 349

猜你喜欢

转载自blog.csdn.net/qq_45538469/article/details/104919161