您的位置:首页 > 其它

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

2017-07-24 16:20 387 查看
网上搜到的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[/code] 
windows下,直接在user目录中创建一个pip目录,如:C:\Users\xx\pip,新建文件pip.ini,内容如下

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple[/code] 
                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: