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屋!