Solving Slow pip Downloads (Using Tsinghua Mirror)

Translation Notice
This article was machine-translated using DeepSeek-R1.

  • Original Version: Authored in Chinese by myself
  • Accuracy Advisory: Potential discrepancies may exist between translations
  • Precedence: The Chinese text shall prevail in case of ambiguity
  • Feedback: Technical suggestions regarding translation quality are welcomed

The Python package management tool pip often suffers from slow speeds and frequent download errors. You can use Tsinghua University’s mirror site to replace the default download source. Both methods below work on any computer. Demonstration is performed on Windows 10 Version 1909.

Temporary Method

Use the mirror temporarily when installing packages via pip (command line):

1
pip install <package-name> -i https://pypi.tuna.tsinghua.edu.cn/simple

Comfortable

Permanent Method

Open command line and execute:

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

Hows this speed

1.1MB/s 2.2MB/s 6.8MB/s

P.S. I found $N$ articles online all suggesting to manually create pip.ini files…

Licensed under CC BY-NC-SA 4.0
Built with Hugo
Theme Stack designed by Jimmy