pip.conf可以同时指定两个index-url吗? [英] Can pip.conf specify two index-url at the same time?
问题描述
我尝试在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屋!