Python | Change the pip source to a domestic mirror to increase the download speed

Using pip to install some libraries may be slower, you can consider using domestic mirrors

1. Some common domestic images of pip are as follows:

1. Alibaba Cloud

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

2. University of Science and Technology of China

https://pypi.mirrors.ustc.edu.cn/simple/

3. Douban

http://pypi.douban.com/simple/

4. Tsinghua University

https://pypi.tuna.tsinghua.edu.cn/simple/

2. Modify the source method:

1. Temporary use:

You can add -iparameters to specify the pip source when using pip

pip install xxx -i https://pypi.mirrors.ustc.edu.cn/simple/

2. Permanent modification:

linux:

Modify ~/.pip/pip.conf(create one if not), the content is as follows:

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

windows:

Create a pip directory directly in the user directory, such as:, create a C:\Users\xxx\pipnew file pip.ini, the content is as follows

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

Guess you like

Origin blog.csdn.net/y1534414425/article/details/106048319