Fundamentals 3 min read

Speed Up Python Package Installs with Chinese Mirrors: Quick Setup Guide

Learn how to bypass slow or timed‑out Python package installations by using popular domestic mirror sites, and configure pip for temporary or permanent use on both Windows and Linux environments.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Speed Up Python Package Installs with Chinese Mirrors: Quick Setup Guide

When installing Python packages, you may encounter long waits or timeout errors. Using domestic mirror sites can dramatically speed up the process.

1. Popular Chinese mirror URLs

https://pypi.douban.com/simple/       # Douban
http://mirrors.aliyun.com/pypi/simple/ # Alibaba Cloud
http://pypi.hustunique.com/simple/   # HUST
http://pypi.sdutlinux.org/simple/   # Shandong University of Technology
http://pypi.mirrors.ustc.edu.cn/simple/ # USTC
https://pypi.tuna.tsinghua.edu.cn/simple # Tsinghua

2. Install a package temporarily from a mirror

# Add "-i" or "--index-url" parameter
pip install package_name -i https://pypi.douban.com/simple

3. Set a permanent default mirror on Windows

Create a pip folder in your user directory (e.g., C:\Users\YourName\pip) and add a pip.ini file with the following content:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = mirrors.aliyun.com

4. Set a permanent default mirror on Linux

Edit or create ~/.pip/pip.conf (create the .pip directory if it does not exist) and add:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host = mirrors.aliyun.com
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.

Chinapippackage-mirror
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

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.