PIP: create a PIP. Conf file in the current user directory and add the source address.
mkdir ~/.pip
vim ~/.pip/pip.conf
# Then copy in the following two lines
[global]
index-url = https://mirrors.aliyun.com/pypi/simple
# -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --Other domestic PIP source tsinghua: https://pypi.mirrors.ustc.edu.cn/simple/, https://pypi.tuna.tsinghua.edu.cn/simple, China university of science and technology, huazhong university of science and Shandong university of science and technology: http://pypi.hustunique.com/ http://pypi.sdutlinux.org/ douban: http://pypi.douban.com/simple/Copy the code
Sometimes PIP install packages still get stuck in the process of installing other packages, so you can modify the source code in Python
Go directly to the python installation directory – packages/setuptools/lib/site package_index. Py to modify index_url inside