Install EASY_INSTALL and PIP using image sources

Source: Internet
Author: User


Using easy_install and pip makes installation and management of python modules very convenient. I usually use easy_install pip to install other modules on the new Linux system. However, in China with the official pypi source (https://pypi.python.org/simple) is generally slow, and even occasionally directly connected to timeout, so it is necessary to use pypi domestic image. I have already recommended images. See this article: Common Open Source image site recommendations.

This article describes how to configure easy_install and pip to use the image pypi in two ways. Taking the TUNA image source of Tsinghua University as an example: https://pypi.tuna.tsinghua.edu.cn/simple

1. Use the pypi image temporarily during command line installation, that is, add the-I https://pypi.tuna.tsinghua.edu.cn/simple parameter.


# Easy_install command line
Easy_install-I https://pypi.tuna.tsinghua.edu.cn/simple pip
 
# Pip install command line

Pip install-I https://pypi.tuna.tsinghua.edu.cn/simple lxml

2. Set the configuration files of easy_install and pip, and permanently set the pypi image source. The command line does not use the-I parameter.
Configuration file of easy_install ~ /. Pydistutils. cfg add the following configuration in it:

[Easy_install]
Index_url = https://pypi.tuna.tsinghua.edu.cn/simple
Pip configuration file ~ /. Pip/pip. conf (you may need to create the. pip directory and pip. conf file), and add the following configuration:

Pip pypi image source configuration Shell

[Global]
Index-url = https://pypi.tuna.tsinghua.edu.cn/simple

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.