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:
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