I'm learning python When , use pip Download some libraries , Sometimes very slow , It was on the verge of collapse . Because the default pip It's using Python Official source , But because foreign official sources are often blocked , Make it unusable , We can use domestic Python Mirror source , So as to solve Python The trouble of not installing the library .
http://pypi.douban.com/simple/ douban
http://mirrors.aliyun.com/pypi/simple/ Ali
http://pypi.hustunique.com/simple/ Huazhong University of technology
http://pypi.sdutlinux.org/simple/ Shandong University of technology
http://pypi.mirrors.ustc.edu.cn/simple/ University of science and technology of China
[global]
timeout = 6000
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com
Here's the picture :cd ~
mkdir -p .pip
nano pip.conf # perhaps vi pip.con
[global]
timeout = 6000
index-url = http://pypi.douban.com/simple
trusted-host = pypi.douban.com
pip Use when installing files : pip install < Package name > –trusted-host pypi.douban.com
such as : pip install pyquery –trusted-host pypi.douban.com
pip install -i https://pypi.doubanio.com/simple/ Django
pip install -i https://pypi.doubanio.com/simple/ --trusted-host pypi.doubanio.com Djang
notes :-i https://pypi.doubanio.com/simple/ ------ Indicates the use of watercress (-i == --index-url)
--trusted-host pypi.doubanio.com -------- Indicates adding trust
Articles you may be interested in