Article Directory
- pip replacement software source
- pip domestic mirror address
- pip source change method
- Temporarily specify the software source
- Permanently modify the software source
- 1. Linux system
- 2. Windows system
pipReplace the software source
Because using pip or pip3 installationpythonWhen third-party packages, read timed out problems often occur, so the official pip needs to be included.softwareThe source server is replaced with a domestic mirror server, thereby improving the installation efficiency and success rate of Python software packages.
pip domestic mirror address
- Alibaba Cloud /pypi/simple/
- University of Science and Technology of China /simple/
- Douban (douban) /simple/
- Tsinghua University /simple/
- University of Science and Technology of China /simple/
pip source change method
Temporarily specify the software source
#Taking the installation of matplotlib using Tsinghua University's mirror source as an example
pip install matplotlib -i /simple/
- 1
- 2
Permanently modify the software source
1. Linuxsystem
Create .pip hidden directory in the current user directory and write the software source address to the file in that directory (whether it is pip or pip3, the method is consistent.)
mkdir -p ~/.pip/
vim ~/.pip/
- 1
- 2
The file contents are as follows
[global]
index-url = /simple
trusted-host =
- 1
- 2
- 3
2. Windowssystem
Create a pip directory in the current user directory, that is, C:\Users\xxx\pip\ (xxx refers to the user name), create a file in the pip directory, the file content is as follows
[global]
index-url = /simple
trusted-host =
- 1
- 2
- 3