stay python In development , Often need to use a variety of Libraries .pip It is also our common installation tool . But the download speed of foreign sources is too slow , Often lead to timeout .
In this case, we can modify pip Download source for domestic source . In this way, the download speed can be greatly improved .
Recommend some good domestic images :
Alibaba cloud :https://mirrors.aliyun.com/pypi/simple/
douban :https://pypi.douban.com/simple/
Tsinghua University :https://pypi.tuna.tsinghua.edu.cn/simple/
University of science and technology of China : http://pypi.mirrors.ustc.edu.cn/simple/
1、 Temporarily replace the mirror source
It can be done by .
python Answering question consulting Learning exchange group 2:660193417###
pip3 install Library name -i Mirror address
This is the way to install .
Such as I want to install numpy library And use douban Mirror source for
pip3 install numpy -i https://pypi.douban.com/simple/
From the downloaded logs , The source address is successfully modified to the address of Douban
python Answering question consulting Learning exchange group 2:660193417###
E:\....\>pip3 install numpy -i https://pypi.douban.com/simple/
Looking in indexes: https://pypi.douban.com/simple/
Collecting numpy
Downloading https://pypi.doubanio.com/packages/07/46/656c25b39fc152ea525eef14b641993624a6325a8ae815b200de57cff0bc/numpy-1.16.4-cp37-cp37m-win32.whl (10.0MB)
100% |████████████████████████████████| 10.0MB 2.9MB/s
Installing collected packages: numpy
Successfully installed numpy-1.16.4
If you use pip The maximum number of modules installed is 40-50KB/s, If you are a domestic image source installation module , A few megabits per second , It's no exaggeration to increase the speed hundreds of times !
Windows Environmental Science .
Turn on my computer , Enter in the address bar %APPDATA% Press enter to jump to the target directory . Create a... In the directory pip file , Then create a pip.ini file . Enter the following information . Take Douban, for example
python Answering question consulting Learning exchange group 2:660193417###
[global]
timeout = 6000
index-url = https://pypi.douban.com/simple/
trusted-host = pypi.douban.com
As shown in the figure
test , After the modification is found, enter directly pip3 install Library name . Download directly from the image source of Douban .
E:\....>pip3 install numpy
Looking in indexes: https://pypi.douban.com/simple/
Collecting numpy
Using cached https://pypi.doubanio.com/packages/07/46/656c25b39fc152ea525eef14b641993624a6325a8ae815b200de57cff0bc/numpy-1.16.4-cp37-cp37m-win32.whl
Installing collected packages: numpy
Successfully installed numpy-1.16.4
Linux perhaps Mac Environmental Science :
stay ~/.pip/pip.conf This directory ( I didn't create one myself ) Put the configuration information above , Modify and save .
Catalog Chapter one Introduct
前言遇見你時,漫天星河皆為浮塵不知從什麼時候開始.小說開始掀
Application of various program
Catalog One 、 Realization eff