Fundamentals 5 min read

Boost Python Package Install Speed on Linux: Quick Guide to Changing pip Mirrors

This article walks you through updating pip on Ubuntu, listing fast domestic mirrors, configuring pip to use a new source, and demonstrates the dramatic download speed improvement you can achieve with a simple command-line change.

Python Crawling & Data Mining
Python Crawling & Data Mining
Python Crawling & Data Mining
Boost Python Package Install Speed on Linux: Quick Guide to Changing pip Mirrors

Hello everyone, after covering pip source changes on Windows, this guide shows how to switch pip mirrors on Linux (Ubuntu 18.04) to speed up Python package installations.

The system uses Python 3.6.9 and pip 9.0.1, which is outdated, so first upgrade pip: sudo python3 -m pip install --upgrade pip Verify the upgrade with: pip -V The default pip source is the official PyPI server, which is often slow.

Common domestic mirrors include:

https://pypi.tuna.tsinghua.edu.cn/simple/  (Tsinghua University)
http://mirrors.aliyun.com/pypi/simple/      (Aliyun)
https://pypi.mirrors.ustc.edu.cn/simple/   (University of Science and Technology of China)
http://pypi.douban.com/simple/            (Douban)

To change the source, run:

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/

This writes the new mirror to pip's configuration ("writing" indicates success).

After switching, download speeds increase dramatically—from about 16 KB/s before to 500 KB/s–4.4 MB/s after the change.

Any yellow warnings simply indicate that an older pip was replaced by the newer version; the new pip now responds to the pip command.

Confirm the setup by opening a Python console and importing a package (e.g., import requests) without errors.

In summary, changing pip's source on Linux is straightforward, significantly speeds up package downloads, and requires only a few commands.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

PythonLinuxpipMirrorspeedpackage installation
Python Crawling & Data Mining
Written by

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!

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.