python换下载源这个事比较简单,但是也有几个小坑,这里做一个记录
python的国内源:
(1)阿里云 http://mirrors.aliyun.com/pypi/simple/
(2)豆瓣http://pypi.douban.com/simple/
(3)清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/
(4)中国科学技术大学 http://pypi.mirrors.ustc.edu.cn/simple/
(5)华中科技大学http://pypi.hustunique.com/
一般用清华大学的 的确比较快
一般有两种用法:
1.临时换源 以换清华大学源下载django为例
python install django -i https://pypi.tuna.tsinghua.edu.cn/simple/
2.永久换源 以windows系统为例
1.打开我的电脑 地址栏输入 %appdata% 回车
2.新建一个pip文件夹 再新建一个pip.ini文件
3.把下列文字写入pip.ini文件并保存即可
[global]
timeout = 6000
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
trusted-host = pypi.tuna.tsinghua.edu.cn
欢迎光临