New to python friend, during use pip install python install third-party libraries will appear in speed is very slow, or install the downloaded to the middle, stopped, stuck, or downloading error and other problems.
Below, the download speed only 4.7kb / s slower than turtle speed slower.
This is because most official sources are abroad, although you can download, but due to the speed limit issue, download very slow.
So how to solve this problem?
That is to replace the python source
Temporary use is in the installation pip install -i + source address + installation library name , which can temporarily solve installation problems
例如:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
This way will go to the library to install opencv-python from Tsinghua mirror
Another way is to permanently modify the source, where my approach is to modify on win10 and effective pro-test
1. Windows under the C drive, Users directory, find the name of your computer, go to the directory
where my name is Administrator
2. after entering the directory, create a folder named PIP
3. into this folder, create a configuration file named pip.ini, where some people may not operate, you can create txt file
to open the Add content, and then change the name of pip.ini
4. contents of the file adding the source address of Tsinghua
[Global]
index-URL = https://pypi.tuna.tsinghua.edu.cn/simple
5. the save, modify the configuration file name pip.ini
6. at this time modified good, you can use, very fast
in the linux environment, modify the ~ / .pip / pip.conf this document. If not, create one directory to be created correctly.
As the content
[Global]
index-URL = https://pypi.tuna.tsinghua.edu.cn/simple
well after modification, can be used.
Some domestic sources:
The new ubuntu require the use of https source, to pay attention.
Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple
Ali cloud: http://mirrors.aliyun.com/pypi/simple/
China University of Science and Technology https://pypi.mirrors.ustc.edu.cn / simple /
Huazhong University of Science: http://pypi.hustunique.com/
Shandong University of Technology: http://pypi.sdutlinux.org/
watercress: http://pypi.douban.com/simple/