banner
李大仁博客

李大仁博客

天地虽大,但有一念向善,心存良知,虽凡夫俗子,皆可为圣贤。

[Linux] Modify the mirror address of easy_install and pip

Using easy_install and pip makes module installation and management in Python very simple. However, if you are in China, the download speed from the official mirror can be frustrating. Just like modifying the mirror address for apt-get or yum, easy_install and pip also need to have their mirror address modified. There are usually two methods to modify the mirror address for easy_install and pip, which can be done using commands or configuration.

Method 1: Temporarily modify easy_install using commands:

easy_install -i http://e.pypi.python.org/simple fabric

pip:

pip -i http://e.pypi.python.org/simple install fabric

Method 2: Modify easy_install using configuration:

  1. Open pydistutils.cfg

vi ~/.pydistutils.cfg

  1. Write the following content:

[easy_install]
index_url = http://e.pypi.python.org/simple

pip:

  1. Open pip.conf

vi ~/.pip/pip.conf

  1. Write the following content:

[global]
index-url = http://e.pypi.python.org/simple

The faster mirror addresses in China are provided by Tsinghua University, with servers located in Beijing. The public server is the official mirror: Public: http://e.pypi.python.org/simple Education network: http://pypi.tuna.tsinghua.edu.cn/simple

The following mirror address is provided by Anjuke: Public: http://pypi.corp.anjuke.com/simple

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.