How to change the Python PIP mirror site

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.

temporary use

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

for example,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.