Pip downloads python third-party libraries too slow, change the source once to solve the problem permanently

Usually when we use pip to download and install third-party libraries, we always feel that the speed is very slow, and often fails, so we can solve the problem by changing the source.
Run commands under linux

vi ~/.pip/pip.conf

windows:

%HOMEPATH%\pip\pip.ini

Then write the following and save

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

The specific method is as follows:
Insert picture description here
Insert picture description here
When changing the source, it is not necessary to use Ali's mirror source, but it can also be replaced with other mirror sources. For example, common domestic mirror sources are:
http://pypi.douban.com/simple/ Douban
http://mirrors .aliyun.com/pypi/simple/ Ali
http://pypi.hustunique.com/simple/ Huazhong University of Science and Technology
http://pypi.sdutlinux.org/simple/ Shandong University of Technology
http://pypi.mirrors.ustc. edu.cn/simple/ University of Science and Technology of China

Guess you like

Origin blog.csdn.net/qq_43811879/article/details/113828942