easy_install 和pip安装软件时使用指定的 源地址

    一般来说,使用国外的网站安装软件有些速度会很慢,因此在安装软件时可以使用国内的网站。

1、临时改变

    使用easy_install安装pip时有时就会很慢,因此可以更换软件源地址:

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

    同时pip安装软件时也可以使用指定的源地址安装软件:

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


2、永久改变

    也可以通过设置easy_install和pip的配置文件永久更换软件源地址:

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

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


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

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



本文转自 f_066 51CTO博客,原文链接:http://blog.51cto.com/ganmu/1956330,如需转载请自行联系原作者
上一篇:C#发送邮件的实现实例解析


下一篇:此版本的 SQL Server 不支持用户实例登录标志。该连接将关闭“的解决(转)