pip安装第三方库网速慢(解决方案)

Pip安装第三方库网速慢(解决方案)
对于Python开发用户来讲,PIP安装软件包是家常便饭。但国外的源下载速度实在太慢,容易下载超时。所以把PIP安装源替换成国内镜像,可以大幅度的提升下载速度,再也不用担心下载慢了。

国内好用的镜像

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

阿里云:http://mirrors.aliyun.com/pypi/simple/

中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/

华中理工大学:http://pypi.hustunique.com/

山东理工大学:http://pypi.sdutlinux.org/ 

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

临时使用

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package


设为默认
升级 pip 到最新的版本 (>=10.0.0) 后进行配置:

pip install pip -U
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

或者直接配置/root/.config/pip/pip.ini内容如下

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

0 0 投票数
Article Rating
订阅评论
提醒
guest
0 评论
最旧
最新 最多投票
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x