解决pip下载速度过慢的方法之一:更改pip下载源

更改pip源

为了解决使用pip安装python相关包速度慢的问题,可以更改pip下载源为国内源。

常见的源网址有:

清华:https://pypi.tuna.tsinghua.edu.cn/simple
中国科学技术大学:https://pypi.mirrors.ustc.edu.cn/simple
阿里云:http://mirrors.aliyun.com/pypi/simple/

其他的源网址可以搜索查找到。

如何修改pip源

在对应的环境中(无论是cmd(windows os),还是在anaconda自己创建的虚拟环境,或者其他环境都可以),输入指令

pip config set global.index-url url(相应的源网址)
例如将源修改为清华源:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

如果得到如下的结果则表明修改成功。在这里插入图片描述

你可能感兴趣的:(python)