Accelerating the online installation of Third-party libraries using the PyPI mirror source

Source: Internet
Author: User
To specify mirrors manually

It is convenient to install a Third-party library with Easy_install and PIP
They are actually downloaded from the official source of Python to the local and then unpack the installation.
But for some reason, the official pypi is unstable, slow or even inaccessible.
Like Ubuntu's apt and CentOS's yum have each mirror source, PyPI also has. Domestic Mirror

PIPY Domestic Mirror currently has: of  Science and technology of China
http://  watercress  Huazhong University of Technology  Shandong University of Technology

This is handy for Pip, which is an online installation, but it's a terrible thing if the network is unstable. Use the domestic mirror relatively better, use the way

If you want to specify the source manually, you can specify the source behind the PIP, such as the source of the watercress, to install the frame:

Pip install-i
pip install requests-i simple/
pip Install-i 

Note: There is a/simple/directory to follow ... made a mistake.

The PIP was upgraded today, and then the PIP was used to specify a mirrored installation and an error.

Collecting requests the
  repository located at isn't a trusted or secure host and is being ignored. If This repository is available via HTTPS it are recommended to use HTTPS instead otherwise your may silence this warning a nd allow it anyways with '--trusted-host '.
  Could not find a version this satisfies the requirement requests (from versions:)
No matching distribution for Requests

This is because mirroring is not a reason for HTTPS.
For mirroring that supports HTTPS, it's better to have the URL changed to HTTPS.
For example

Pip Install-i

For mirrors that do not support HTTPS, I will be replaced with--trusted-host.
The order is as follows:

Pip install requests--trusted-host
pip install--trusted-host http:// 
Configure default Mirrors

If you do not want to specify mirroring each time, you can set the location of the profile configuration file

New version pip: $HOME/.config/pip/pip.conf
History remains a problem, $HOME/.pip/pip.conf also support
In virtual environments: $VIRTUAL _env/pip.conf
If the configuration file does not exist, create it yourself.

Updated March 16, 2017: I've found the PIP profile path for $home/.pip/pip.conf to Add code from the Aliyun Ubuntu 16.04 Server

Timeout =
Index-url =

For more configuration, refer to official documentation:

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: 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.