pip下载速度过慢的原因就是 pip 默认使用的是国外的源,那么我们只要把国外的源换成国内的,下载速度就可以提升很多了
可以直接使用以下代码设置 pip 的源,即添加通道地址:(不推荐更改配置文件):
(1)pip config --add channels 通道地址
(2)pip config --remove channels 通道地址(删除)
设置之后,正常下载包即可
eg:
pip install pandas
还可以用指定镜像下载:(eg:清华镜像)(推荐:只对这一条指令有效,没有更改配置文件)
pip install 包名 -i https://pypi.tuna.tsinghua.edu.cn/simple
或
pip install xxx -c 通道地址
pip create xxx -c 通道地址
国内通道地址:
清华镜像:https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
北京外国语大学镜像:https://mirrors.bfsu.edu.cn/anaconda/pkgs/main
阿里巴巴镜像:http://mirrors.aliyun.com/anaconda/pkgs/main
【查看配置文件有哪些通道(channels:下载的通道,默认defaults,即国外的服务器上)】
conda config --get (推荐)文章来源:https://www.toymoban.com/news/detail-427827.html
conda config --show文章来源地址https://www.toymoban.com/news/detail-427827.html
到了这里,关于解决pip下载速度慢的问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!