Home > Article > Backend Development > How to configure Tsinghua mirror source in Python
This article introduces how to configure Tsinghua mirror source in Python. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
1. Preface
Use pip to install the python library of the server abroad When downloading, it takes a long time to download. Setting domestic mirrors in the configuration file can increase the speed. Tsinghua mirror source is one of them.
2.pypi Mirror usage help
URL: https://mirrors.tuna.tsinghua.edu.cn/help/pypi/
3. Temporary configuration
If you only temporarily download a python library, you can use the following command to configure it:
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
Description: "some-package" is the python library to be downloaded name (or package name).
4. Default configuration (permanent configuration)
pip install pip -U pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Instructions:
(1) "pip install pip -U" is the command used to upgrade pip ;
(2) If pip is version 10.0.0 or above, you can upgrade;
(3) Command to view the pip version: pip -V
Related free Learning recommendation: python video tutorial!
The above is the detailed content of How to configure Tsinghua mirror source in Python. For more information, please follow other related articles on the PHP Chinese website!