Download the Python package using the Douban source

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.