Demand
Python default use of foreign source download dependency package, due to some other factors (such as the network is bad, foreign machines blew up, our strong motherland ...) Often causes the download installation to fail, so there is a main source of the domestic download of watercress
How to use the watercress to download
Watercress: Http://pypi.douban.com/simple
1, use pip download to specify the use of watercress source as a download source (here we download tornado)
Pip Install Tornado-i http://pypi.douban.com/simple
The following error has occurred-. -
Workaround:
Obviously see the hint message there is distrust Douban this download source, then we have to give him a trust action
Pip install tornado-i http://pypi.douban.com/simple--trusted-host pypi.douban.com
In this way, our tornado is downloaded at a rocket-like speed.
2, we encountered a problem when using the PIP tool to download Tornado, PIP is not installed-. -Now install the PIP
Prepare a get-pip.py installation package in advance (find yourself online)
Also use our Douban source to install it (dependent), a command is done
Python get-pip.py-i http://pypi.douban.com--trusted-host pypi.douban.com
3, now has learned to use the domestic douban source download Python package, but encountered a problem, every download to execute so a long list of commands-. -
Of course we have a solution, see below
The first step:
Creating a configuration file
/root/.pip/pip.conf
This configuration file does not exist, and you need to create it manually, not accidentally
Step Two:
Write something in the configuration file, specifically what you mean
[Global]index-url = http://pypi.douban.com/simple[install]trusted- Host = pypi.douban.com
Step Three
You can use it normally, for example
Done. After all the packages you want to download go to our Douban source 0. 0
Download the Python package using the Douban source