python切换pip源

方式一

执行命令 进行更换源 以清华源为例:

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

移除更换的源

pip config unset global.index-url

方式二

在用户目录中创建 pip.config
路径 ~/.config/pip/pip.conf ,添加内容如下

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple

方式三 (不更换源,配置代理)

直接在pip命令中使用代理

pip install  --proxy=http://127.0.0.1:1080

源地址:

清华源:
https://pypi.tuna.tsinghua.edu.cn/simple

阿里云源:
http://mirrors.aliyun.com/pypi/simple/

中科大源: 
https://pypi.mirrors.ustc.edu.cn/simple/

豆瓣源:
http://pypi.douban.com/simple/

你可能感兴趣的:(python切换pip源)