【问题标题】:How do i declare more than one extra-index-url in pip.conf如何在 pip.conf 中声明多个额外索引 URL
【发布时间】:2016-08-12 20:22:39
【问题描述】:

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

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

【问题讨论】:

    标签: python pip


    【解决方案1】:

    虽然the docs 中的示例是针对--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

    【讨论】:

      【解决方案2】:

      试试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
      

      【讨论】:

        猜你喜欢
        • 2011-11-28
        • 2019-04-07
        • 1970-01-01
        • 2014-08-18
        • 2023-01-28
        • 2012-01-24
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多