current position:Home>Python solve the problem of slow download and installation of Pip

Python solve the problem of slow download and installation of Pip

2022-07-25 11:25:42fatfatmomo

Give Way PIP Source uses domestic image , Improve download speed and installation success rate .

about Python For development users ,PIP It's common to install software packages . But the download speed of foreign source is too slow , A waste of time . And there are often installation errors after downloading . So the PIP Replace the installation source with the domestic image , Can greatly improve the download speed , The installation success rate can also be improved .

Domestic source :

new edition ubuntu Required https Source , it is to be noted that .

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

Alibaba cloud :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/

Temporary use :

Can be used in pip When adding parameters -i https://pypi.tuna.tsinghua.edu.cn/simple

for example :pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pyspider, In this way, you can install the image from Tsinghua pyspider library .
 

Permanent modification , Once and for all :

Linux Next , modify ~/.pip/pip.conf ( No create a folder and file . Folder to add “.”, Means to hide the folder )

The contents are as follows :

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
[install]
trusted-host=mirrors.aliyun.com

windows Next , Directly in user Create a pip Catalog , Such as :C:\Users\xx\pip, New file pip.ini. Same as above .

Or do not replace the installation source , Try a stupid way :pip --default-timeout=1000 install -u xxx (xxx Name the package you want to install )

Original web page :http://www.cnblogs.com/microman/p/6107879.html

copyright notice
author[fatfatmomo],Please bring the original link to reprint, thank you.
https://en.pythonmana.com/2022/206/202207251026258958.html

Random recommended