1. 程式人生 > >easy_install 和pip安裝軟件時使用指定的 源地址

easy_install 和pip安裝軟件時使用指定的 源地址

pip

一般來說,使用國外的網站安裝軟件有些速度會很慢,因此在安裝軟件時可以使用國內的網站。

1、臨時改變

使用easy_install安裝pip時有時就會很慢,因此可以更換軟件源地址:

easy_install -i https://mirrors.aliyun.com/pypi/simple pip

同時pip安裝軟件時也可以使用指定的源地址安裝軟件:

pip install -i https://pypi.tuna.tsinghua.edu.cn/simple lxml


2、永久改變

也可以通過設置easy_install和pip的配置文件永久更換軟件源地址:

easy_install的配置文件 ~/.pydistutils.cfg ,可以在其中添加如下內容:

[easy_install]
index_url = https://pypi.tuna.tsinghua.edu.cn/simple


pip的配置文件 ~/.pip/pip.conf (可能需要創建.pip目錄及pip.conf文件),在其中添加如下內容:

[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple


參考地址:

http://smilejay.com/2016/06/use-mirror-with-easy_install-and-pip/

http://topmanopensource.iteye.com/blog/2004853



本文出自 “甘木” 博客,請務必保留此出處http://ganmu.blog.51cto.com/9305511/1956330

easy_install 和pip安裝軟件時使用指定的 源地址