pip查看镜像源和更换镜像源

查看镜像源
在这里插入图片描述

在这里插入图片描述
一行代码换源:pip config set global.index-url https://pypi.mirrors.ustc.edu.cn/simple/

pip3 config set global.index-url https://pypi.douban.com/simple/
常用的镜像源
http://mirrors.aliyun.com/pypi/simple/
https://pypi.tuna.tsinghua.edu.cn/simple/

http://pypi.mirrors.ustc.edu.cn/simple/
https://pypi.douban.com/simple/

方法二:

mkdir ~/.pip

vim ~/.pip/pip.conf

把下面几行贴进去

[global]

pip-url = http://mirrors.aliyun.com/pypi/simple

pip-url = https://pypi.tuna.tsinghua.edu.cn/simple

[install]

trusted-host=mirrors.aliyun.com

这里~可能是/root也有可能是你的用户比如说/home/xxx/.pip

选择清华或者阿里都行,都有技术人员专门维护。

不知道如何修改文件,参考系列博客,文件创建修改篇。i修改,esc切换模式,:wq保存,如果保存不了就:q! 强行退出。

可参考的源还有很多,把pip-url换掉即可。比如豆瓣的,科大的,都很快

你可能感兴趣的:(python,开发语言,linux)