首页 > 其他 > 详细

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

时间:2017-08-15 14:06:24      阅读:300      评论:0      收藏:0      [点我收藏+]

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

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安装软件时使用指定的 源地址

原文:http://ganmu.blog.51cto.com/9305511/1956330

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!