三大国内源:
- 豆瓣:http://pypi.douban.com/simple/
- 中科大:https://pypi.mirrors.ustc.edu.cn/simple/
- 清华:https://pypi.tuna.tsinghua.edu.cn/simple
永久修改:
Windows版本:(代码中用的豆瓣源)
自己在C:\Users\<username>路径下新建文件夹pip,
创建文件C:\Users\<username>\pip\pip.ini,用记事本打开,内容为:
[global]
index-url = https://pypi.douban.com/simple
Linux版本:
修改pip.conf,各个系统存放的位置不一样,Linux请用find自行查找
[global]
index-url = https://pypi.douban.com/simple
如果只想本次使用国内源,pip时请加上:
pip install XXXXXX -i https://pypi.douban.com/simple