1、PYPI国内源路径
(清华镜像地址)
https://pypi.tuna.tsinghua.edu.cn/simple/
(中科大镜像地址)或者
https://pypi.mirrors.ustc.edu.cn/simple/
(阿里云镜像地址)或者
https://mirrors.aliyun.com/pypi/simple/
(华中科技大学)或者
http://pypi.hustunique.com/
(豆瓣镜像地址)或者
http://pypi.douban.com/simple/
2、临时更改源文件
pip install xxx -i ’国内源路径 例如: pip install six -i
3、永久更换
mkdir ~/.pip
cd ~/.pip
touch pip.conf
#以下配置写入pip.conf(使用的是阿里云源)
[global]
index-url = https://mirrors.aliyun.com/pypi/simple
[install]
mirrors = http://mirrors.aliyun.com/pypi/simple
trusted-host = mirrors.aliyun.com
4、使用echo方法写入到pip.conf
echo -e "[global]\nindex-url = https://mirrors.aliyun.com/pypi/simple\n[install]\nmirrors = http://mirrors.aliyun.com/pypi/simple\ntrusted-host = mirrors.aliyun.com\n" >> pip.conf
5,一条命令配置镜像源
mkdir ~/.pip && cd ~/.pip && touch pip.conf && echo -e "[global]\nindex-url = https://mirrors.aliyun.com/pypi/simple\n[install]\nmirrors = http://mirrors.aliyun.com/pypi/simple\ntrusted-host = mirrors.aliyun.com\n" >> pip.conf