pip国内镜像 -i http://pypi.douban.com/simple

pipy国内镜像目前有:

新加个阿里云的镜像

pip install robotframework -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

 

http://pypi.douban.com/  豆瓣

http://pypi.hustunique.com/  华中理工大学

http://pypi.sdutlinux.org/  山东理工大学

http://pypi.mirrors.ustc.edu.cn/  中国科学技术大学

 

对于pip这种在线安装的方式来说,很方便,但网络不稳定的话很要命。使用国内镜像相对好一些,

 

如果想手动指定源,可以在pip后面跟-i 来指定源,比如用豆瓣的源来安装web.py框架:

pip install web.py -i http://pypi.douban.com/simple

 

注意后面要有/simple目录!!!

 

要配制成默认的话,需要创建或修改配置文件(linux的文件在~/.pip/pip.conf,windows在%HOMEPATH%\pip\pip.ini),修改内容为:

code:

[global]

index-url = http://pypi.douban.com/simple

 

这样在使用pip来安装时,会默认调用该镜像。

更多配置参数见:http://www.pip-installer.org/en/latest/configuration.html

 

 

 

Configuration

Config file

pip allows you to set all command line option defaults in a standard ini style config file.

The names and locations of the configuration files vary slightly across platforms.

  • On Unix and Mac OS X the configuration file is: $HOME/.pip/pip.conf
  • On Windows, the configuration file is: %HOME%\pip\pip.ini

You can set a custom path location for the config file using the environment variable PIP_CONFIG_FILE.

The names of the settings are derived from the long command line option, e.g. if you want to use a different package index (--index-url) and set the HTTP timeout (--default-timeout) to 60 seconds your config file would look like this:

[global]
timeout = 60
index-url = http://download.zope.org/ppix 
  • 0
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值