修改python包pip下载国内源

第一种方式-

pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

附国内常用镜像源:
阿里云:https://mirrors.aliyun.com/pypi/simple/
中国科技大学:https://pypi.mirrors.ustc.edu.cn/simple/
清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/

豆瓣(douban) http://pypi.douban.com/simple/
原始 https://pypi.python.org/simple

第二种方式-

在Linux系统中,修改~/.pip/pip.conf文件;在Windows系统中,修改C:\Users\XXX\pip\pip.ini文件。如果没有上述文件,需要手动建立。
在文件中输入以下内容:

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

 

posted @ 2020-05-13 09:54  tangsong  阅读(1567)  评论(0编辑  收藏  举报