Skip to content

--extra-index-url in requirements.txt #8103

Closed
@survivorbat

Description

@survivorbat

Environment

  • pip version: 20.0.2 / 20.0.2
  • Python version: 3.6.9 / 3.8.0
  • OS: Linux Mint / MacOS
  • keyring package: 21.2.0 / 21.2.0
  • artifacts-keyring package: 0.2.9 / 0.2.9

Description
We are using an Azure DevOps artifact feed to provide our users with a 'mypackage' package. We're currently building applicationB that has this mypackage package as a dependency in the requirements.txt.

To add the azure artifacts index to the install command, we've added --extra-index-url https://pkgs.dev.azure.com/<org>/_packaging/mypackage/pypi/simple/ at the top of the requirements.txt file and added the mypackage package to the requirements.txt list.

Running pip install -r requirements.txt gives me the following error:

Looking in indexes: https://pypi.org/simple, https://pkgs.dev.azure.com/<org>/_packaging/mypackage/pypi/simple/
ERROR: Could not find a version that satisfies the requirement mypackage>=1.0.0 (from -r requirements.txt (line 2)) (from versions: none)
ERROR: No matching distribution found for mypackage>=1.0.0 (from -r requirements.txt (line 2))

Installing this package with an explicit --extra-index-url like so: pip install -r requirements.txt --extra-index-url https://pkgs.dev.azure.com/<org>/_packaging/mypackage/pypi/simple/ however, works perfectly and installs the packages like it should.

Installing it also works when I add the extra index url to my global pip.conf settings.

Expected behavior
I expect all the dependencies (pypi and private azure artifacts feed) to be installed without issues using the pip install -r requirements.txt and without having to explicitly configure the index url in my pip configuration.

How to Reproduce

  1. Set up a requirements.txt file with a link to a private pypi repository (azure artifacts?)
    For example:

    --extra-index-url https://pkgs.dev.azure.com/<org>/_packaging/mypackage/pypi/simple/
    mypackage>=1.0.0
    requests
    
  2. Then run pip install -r requirements.txt

  3. An error occurs.

Output

Looking in indexes: https://pypi.org/simple, https://pkgs.dev.azure.com/<org>/_packaging/mypackage/pypi/simple/
ERROR: Could not find a version that satisfies the requirement mypackage>=1.0.0 (from -r requirements.txt (line 2)) (from versions: none)
ERROR: No matching distribution found for mypackage>=1.0.0 (from -r requirements.txt (line 2))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions