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

后端 未结 3 1788
故里飘歌
故里飘歌 2020-12-02 14:26

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 sup

3条回答
  •  时光说笑
    2020-12-02 14:49

    If you want more than one package index you have to use the --extra-index-url

    From the pip man page:

       -i,--index-url 
              Base URL of Python Package Index (default https://pypi.python.org/simple/).
    
       --extra-index-url 
              Extra URLs of package indexes to use in addition to --index-url.
    

    In pip.conf the name of settings must be put without --. From the documentation:

    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
    

    So you can add in your pip.conf

    extra-index-url = http://myserver.com/pip
    

提交回复
热议问题