Home  >  Article  >  Backend Development  >  Ranking of the best domestic pip sources: Which one is suitable?

Ranking of the best domestic pip sources: Which one is suitable?

WBOY
WBOYOriginal
2024-01-16 09:28:16843browse

Ranking of the best domestic pip sources: Which one is suitable?

Domestic pip source ranking: Which one is worth choosing?

Introduction:
In Python development, pip is one of the most commonly used package management tools. However, due to the complexity of the domestic network environment, downloading using the default pip source may be slow or even fail. In order to solve this problem, major domestic Internet companies and developers have built their own pip sources to provide faster and more stable download services. This article will introduce several popular domestic pip sources and give specific code examples to help you choose the most suitable pip source.

  1. Tsinghua University Open Source Software Mirror Station (https://pypi.tuna.tsinghua.edu.cn/simple)

Tsinghua University Open Source Software Mirror Station is the earliest in China It is also one of the most famous pip sources. Its service is stable, updates quickly, and supports a wide range of software packages. Using this source downloads faster and has been recognized by the majority of developers.

Usage:
Open the terminal and execute the following command:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple [package_name]
  1. Alibaba Cloud (https://mirrors.aliyun.com/pypi/simple/)

Alibaba Cloud is the leading cloud platform provider in China and also provides its own pip source. Compared with other sources, Alibaba Cloud is fast, highly stable, and has a large number of software packages.

Usage:
Open the terminal and execute the following command:

pip install -i https://mirrors.aliyun.com/pypi/simple/ [package_name]
  1. HUAWEI Cloud (https://mirrors.huaweicloud.com/repository/pypi/simple)

Huawei Cloud, as another well-known cloud platform provider, also has its own pip source. This source is relatively stable and has fast download speed, making it a very good choice.

Instructions:
Open the terminal and execute the following command:

pip install -i https://mirrors.huaweicloud.com/repository/pypi/simple [package_name]
  1. Tencent Cloud (https://mirrors.cloud.tencent.com/pypi/simple)

Tencent Cloud is one of the leading cloud service providers in China and also provides its own pip source. This source has high stability, fast download speed, and supports many software packages.

Usage:
Open the terminal and execute the following command:

pip install -i https://mirrors.cloud.tencent.com/pypi/simple [package_name]
  1. Huazhong University of Science and Technology (http://pypi.hustunique.com/)

The pip source provided by Huazhong University of Science and Technology is faster and updated more frequently. This source is available as an alternative.

Usage:
Open the terminal and execute the following command:

pip install -i http://pypi.hustunique.com/ [package_name]

Summary:
The above are several popular pip source rankings in China. They all have certain advantages and applicability. When choosing, you can evaluate by comparing factors such as download speed, stability, supported software packages, and more. Of course, it is recommended to choose the most suitable pip source according to your actual network environment and needs to improve development efficiency.

Note:

  • If you find that the download speed is not ideal when using the above pip source, you can try to change other sources to find the one that suits you best.
  • If you want to set the pip source as the default source, you can execute the following command:

    • Windows command line:

      pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
    • macOS or Linux terminal:

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

      Replace the above URL with the selected pip source address.

Reference link:

  • Tsinghua University open source software mirror station: https://mirrors.tuna.tsinghua.edu.cn /help/pypi/
  • Alibaba Cloud: https://developer.aliyun.com/mirror/pypi
  • Huawei Cloud: https://mirrors.huaweicloud.com/
  • Tencent Cloud: https://cloud.tencent.com/document/product/845/43155
  • Huazhong University of Science and Technology: http://pypi.hustunique.com/

The above is the detailed content of Ranking of the best domestic pip sources: Which one is suitable?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn