Speed Up Python Package Installs: Switch pip to a Domestic Mirror
This tutorial explains why changing pip's default source to a domestic mirror can dramatically improve download speed and reliability, lists popular Chinese mirrors, and shows the single command needed to permanently configure pip for faster package installation.
The article introduces the problem of slow and error‑prone pip installations when packages are fetched from overseas PyPI servers and explains why switching to a domestic mirror is beneficial.
1) Domestic source list
Several Chinese mirrors replicate the official PyPI repository; five commonly used mirrors are shown in the image below.
2) How to change source
Instead of manually editing configuration files, you can use a single pip command to set the global index URL. pip config set global.index-url <source_url> For example, to use the Tsinghua University mirror, run:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/The speed improvement is demonstrated in the following screenshots.
3) Summary
The guide covers two main points: a list of domestic mirrors and the permanent pip configuration command. pip config set global.index-url <source_url> Remember the command and the mirror URL you prefer, and you’ll enjoy much faster Python package installations.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Python Crawling & Data Mining
Life's short, I code in Python. This channel shares Python web crawling, data mining, analysis, processing, visualization, automated testing, DevOps, big data, AI, cloud computing, machine learning tools, resources, news, technical articles, tutorial videos and learning materials. Join us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
