Can pip.conf specify two index-url at the same time?

In your pip.conf, you will also have to add both of the index hosts as trusted, so would look something like this:

[global]
index-url = http://download.zope.org/simple
trusted-host = download.zope.org
               pypi.org
               secondary.extra.host
extra-index-url= http://pypi.org/simple
                 http://secondary.extra.host/simple

In this example, you have a primary index and two extra index urls and all hosts are trusted.

If you don’t specify the host as trusted, you will get the following error:

The repository located at secondary.extra.host is not a trusted or secure host and is being ignored. If this repository is available via HTTPS it is recommended to use HTTPS instead, otherwise you may silence this warning and allow it anyways with ‘–trusted-host secondary.extra.host’.

Cheers!

Leave a Comment