This blog is to give the idea how to configure the python pip mirror site particular in China. Because it may take some times to get the pip module from the original site.
I refer to the blog at https://mirror.tuna.tsinghua.edu.cn/help/pypi/.
pypi image help
The pypi image is synchronized every 5 minutes.
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
Note, please use the https instead of http
set as Default
Upgrade pip to the latest version (>=10.0.0) and configure:
pip install pip -U pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
If your network connection to the default source of pip is poor, temporarily use this mirror site to upgrade pip:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U