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/

链接:https://www.jianshu.com/p/2fad6da4721d
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
扎眼的阳光的头像扎眼的阳光普通用户
上一篇 2023年11月9日
下一篇 2023年11月9日

相关推荐