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.
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 # Tsinghua2. Install a package temporarily from a mirror
# Add "-i" or "--index-url" parameter
pip install package_name -i https://pypi.douban.com/simple3. 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.com4. 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.comSigned-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.
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.
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.
