Python pip Modify Source

Source: Internet
Author: User

Due to some irresistible factors, Python's official package is sometimes inaccessible or network-unstable in the country. To solve this problem, you need to modify the source address that comes with the PIP to the mirror address.


The more well-received image addresses currently collected are:


http://pypi.v2ex.com/simple/

http://pypi.douban.com/simple/

http://mirrors.aliyun.com/pypi/simple/

How to modify the configuration directly:


Windows system


Create the PIP directory under the User folder and create the Pip.in file (%homepath%pippip.ini) in the PIP directory, and add the following to the file:


[Global]

Trusted-host=mirrors.aliyun.com

index-url=http://mirrors.aliyun.com/pypi/simple/

Note: Index-url is the source address, Trusted-host is the domain name of the source address, because the domestic source image is the use of HTTPS protocol, so if you do not add the trust domain will be reported:


This repository located at Mirrors.aliyun.com are not a trusted host, if this repository was available via HTTPS it is recom Mend to use HTTPS instead, otherwise the silence this warning with ' –trusted-host mirrors.aliyun.com '.

Deprecation:implicitly allowing locations which is not hosted at a secure origin is deprecated and would require the use Of–trusted-host in the future.

Requirement already UP-TO-DATE:PIP In/usr/lib/python2.7/site-packages


Linux Systems


The only thing that is different from the Windows system is the address of the configuration file, the Linux file in ~/.pip/pip.conf


Do not change the configuration file, each time manually specify:


Pip Install-i http://<mirror>/simple <package>

For example


Pip Install-i http://pypi.douban.com/simple Simplejson


This article is from the "My Ops Time" blog, so be sure to keep this source http://aaronsa.blog.51cto.com/5157083/1859600

Python pip Modify Source

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.