Press "Enter" to skip to content

Linux配置pip使用国内镜像加速

在linux系统中,在~/目录下新建文件夹.pip,并新建编辑pip.conf文件,加入如下内容:

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

示例用的是清华大学的源,国内还有很多其他的源,比如:

豆瓣:https://pypi.douban.com/simple

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

[global]
index-url=http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com

参考资料:

https://blog.csdn.net/Kris__zhang/article/details/117410816

https://anxiang1836.gitbook.io/ubuntu-guide/01-ubuntu-setting/04-pip-speedup

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注