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