Use PYTHON to build an HTTP proxy for PIP

Source: Internet
Author: User

On a machine that does not have Root privileges, deploying a service written using Python seems to be the only virtualenv way to choose. Of course, I've seen some colleagues compile one in their home directory and then set up $PATH, but it's more cost-effective to use virtualenv for versatility and ease of deployment. After creating the environment with VIRTUALENV, the next step is to install the various packages. Pip can be very convenient (and not all very convenient, such as Mysql-python) to install a variety of packages, the only disadvantage is

Too

Slow

The

!

After searching, found that the watercress provides the source of the PIP, can make the installation process is both sour and enjoyable:

Install -I http:///pypi.douban.com/simple eventlet

With the source of watercress, software download speed to make you embarrassed, never worry about the OP to execute your online single failure.

Originally thought, set up the environment of things to end, did not think I was still too young, on-line single and there is a problem.

This time is not a slow, not slow problem, has become the question of whether there is an external network permissions. Company room machine, with strict (Che) lattice (Dan) of the Rights management, managed by the authority, nature also includes access to the external network permissions. It is obviously impossible for a machine not to have access to the network: the department that OP is in does not, and the time it takes to apply for permission is wasted.

Fortunately, Pip also support agents, I just need to find a network with the rights of the development machine, and then set up a proxy server, and then use this agent in the PIP can be. Making wheels is not (Zao) (BU) (chu) (LAI), so I found the example provided by twisted to build a proxy service in minutes.

The final step is to use a proxy for the PIP:

Install -I http:///pypi.douban.com/simple  http://10.11.12.13: 8008 Eventlet

Use PYTHON to build an HTTP proxy for PIP

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.