pip 更换源

pip install 安装模块时有时超级慢,甚至不能安装成功,那么我们可以更换源,如 清华:https://pypi.tuna.tsinghua.edu.cn/simple

1、临时使用

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

2、永久使用

更改配置文

修改 ~/.pip/pip.conf 文件(没有的话自己创建,操作系统是linux)

编辑pip.conf文件,查看内容如下(红色框内为要更换的源)

这样再使用一般速度就会快很多了。

原文地址:https://www.cnblogs.com/liangping/p/7609199.html