繁体   English   中英

我如何在 pip.conf 中声明多个 extra-index-url

[英]How do i declare more than one extra-index-url in pip.conf

我应该在 pip.conf 的什么地方设置它?

我想在 pip.conf 中添加两 (2) 个额外索引 url,但在对文档进行一些研究后,我没有找到如何执行此操作的解决方案。

虽然文档中的示例是针对--find-links ,但它说:

--find-links这样的附加选项可以写在多行上:

[global]
find-links =
    http://download.example.com

[install]
find-links =
    http://mirror1.example.com
    http://mirror2.example.com

所以我相信你可以为extra-index-url做同样的事情。 虽然我遇到了我正在测试的索引的问题,但我可以确认在命令行中传递两次参数与在多行上分离两个索引具有相同的效果,就像这个例子那样。

编辑:我可以确认这确实适用于extra-index-url

尝试使用index-url加上extra-index-urls ,例如:

#content of ~/.config/pip/pip.conf
[global]
index-url=https://<some-other-index>
extra-index-url=https://pypi.org/simple

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM