Solutions to slow installation of PIP install

Time:2019-11-29

Today, some friends who have just contacted Python are using PIP install to install Python third-party libraries

There will be some problems such as slow network speed, halfway installation and download, stop, card owner, or download error. The following picture:

There are also some problems, such as in my figure, the download speed is only 4.7kb/s slower than tortoise speed.

How to solve this problem?

Is to replace the python source

The temporary use method is to install PIP install – I + source address + installation library name, which can temporarily solve the installation problem

For example: PIP install – ihttps://pypi.tuna.tsinghua.edu.cn/simpleopopencv-python

In this way, the image of Tsinghua will be installedopencv-pythonThis library

Another way is to permanently modify the source. My method here is to modify it on win10, which is effective through personal test

Under windows, under the directory of C disk and users, find your own computer name and enter the directory

Here my name is administrator

After entering the directory, create a folder named pip

After entering this folder, create a configuration file named pip.ini. Some friends here may not be able to operate it. You can create it as a TXT file first

Open add content, and then change the name to pip.ini

Add Tsinghua’s source address


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

After saving, modify the configuration file name to pip.ini

At this time, after modification, it can be used. The speed is swish~~~

In Linux environment, modify~/.pip/pip.confIf there is no such file, create one. The directory should be created correctly.

The modification is the same


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

After modification, it can be used.

Some domestic sources:

The new version of Ubuntu requires the use of HTTPS source, which should be noted.

Tsinghua: https://pypi.tuna.tsinghua.edu.cn/simple

Alicloud: http://mirrors.aliyun.com/pypi/simple/

University of science and technology of China https://pypi.mirrors.ustc.edu.cn/simple/

Huazhong University of Technology: http://pypi.hustunique.com/

Shandong University of Technology: http://pypi.sdutlinux.org/

Douban: http://pypi.douban.com/simple/

summary

The above is a solution for slow installation of PIP install, a third-party library for Python installation introduced by Xiaobian. I hope it can help you. If you have any questions, please leave a message to me and Xiaobian will reply to you in time. Thank you very much for your support of the developepaer website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!