pip.conf可以同时指定两个index-url吗? [英] Can pip.conf specify two index-url at the same time?

查看:530
本文介绍了pip.conf可以同时指定两个index-url吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在pip.conf中使用带有index-url的pip.但是,我不能确保我们可以获取所有必需的python库.因此,我想知道pip支持是否在pip.conf[global]部分中指定多个index-url.

I have tried using pip with index-url in pip.conf. However, i can not make sure that we can get all the necessary python library. So, i want to know if pip support specify more than one index-url in [global] section in pip.conf.

推荐答案

如果要多个包索引,则必须使用--extra-index-url

If you want more than one package index you have to use the --extra-index-url

pip手册页:

   -i,--index-url <url>
          Base URL of Python Package Index (default https://pypi.python.org/simple/).

   --extra-index-url <url>
          Extra URLs of package indexes to use in addition to --index-url.

pip.conf中,设置名称必须不带--.从文档:

In pip.conf the name of settings must be put without --. From the documentation:

这些设置的名称来自长命令行选项,例如如果要使用其他程序包索引(--index-url)并将HTTP超时(--default-timeout)设置为60秒,则配置文件将如下所示:

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

因此您可以添加您的pip.conf

extra-index-url = http://myserver.com/pip

这篇关于pip.conf可以同时指定两个index-url吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆