The configuration steps of pip domestic source are as follows: 1. Enter the "pip config edit" command to open the pip configuration file; 2. Add "index-url =
"; 3. Save the modified file and exit the editor; 4. In the terminal or command line, enter the "pip install " command to test whether the configuration is successful.
# Operating system for this tutorial: Windows 10 system, Dell G3 computer.
In China, using the default pip source to download Python packages may be subject to network restrictions, resulting in slow download speeds or inability to connect. In order to solve this problem, you can configure the domestic pip source to speed up the download.
The following are some commonly used domestic pip sources:
The following are the steps to configure the pip source:
pip config edit
[global] index-url = https://pypi.tuna.tsinghua.edu.cn/simple
or
[global] index-url = http://mirrors.aliyun.com/pypi/simple/
or
[global] index-url = http://pypi.douban.com/simple/
according to your Configure the selected source.
Save and close file: Save the modified file and exit the editor.
Test whether it is successful: In the terminal or command line, enter the following command to test whether the pip source is successfully configured:
pip install 包名
Among them, "Package name" is the name of the Python package you want to install. If the download speed is fast and the package is successfully installed, the pip source has been successfully configured.
The above is the detailed content of How to configure pip domestic source. For more information, please follow other related articles on the PHP Chinese website!