Home > Backend Development > Python Tutorial > How to set up Tsinghua source with pip

How to set up Tsinghua source with pip

小老鼠
Release: 2024-04-23 15:03:44
Original
5724 people have browsed it

Setting method: 1. Open a terminal or command prompt window; 2. Run the "touch ~/.pip/pip.conf" command to create a configuration file named pip; 3. Open the pip.conf file , and then add the content "[global];index-url = https://pypi.tuna.tsinghua.edu.cn/simple", which will set the mirror source of pip to that of Tsinghua University; 4. Save and close Just file.

How to set up Tsinghua source with pip

The operating system for this tutorial: Windows 10 system, Python version 3.11.4, Dell G3 computer.

To set pip to use the mirror source of Tsinghua University, you can follow the following steps:

1. First, open a terminal or command prompt window.

2. Run the following command to create a configuration file named pip (skip this step if it already exists):

touch ~/.pip/pip.conf
Copy after login

3. Open the pip.conf file, and create a new one if it does not exist. One, and then add the following content:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
Copy after login

This will set the mirror source of pip to the mirror source of Tsinghua University.

4. Save and close the file.

Now, your pip will use Tsinghua University’s mirror source to download Python packages and libraries. This setting can speed up downloads and improve stability.

Everyone is watching recently

[shoudongurl]Use Pip to set up Tsinghua source and optimize the download speed of Python packages[/shoudongurl]

[shoudongurl]How does pip specify the source installation[/shoudongurl]

[shoudongurl]How does pip view the source[/shoudongurl]

The above is the detailed content of How to set up Tsinghua source with pip. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template