Skip to content

Cannot install package offline with VCS dependencies, even if they are pre-installed #10614

Open
@alkasm

Description

@alkasm

Description

Offline installations of a package with a VCS URL dependency fails even if the dependency is already installed. This happens because pip tries to pull the VCS URL, and when it can't it fails.

Recently (not sure when, possibly when the new resolver rolled out), I believe VCS-specified dependencies became "eager by default" in pip, so that they are downloaded even when already installed (to install and check version metadata, etc). This means that invoking pip install with VCS URL dependencies fails offline. To counteract this, we can use --no-deps to not install the dependencies, but then you must forego the version checking that pip does on all the other packages which are currently installed. Alternatively, I get around both problems using --use-deprecated legacy-resolver.

I marked this as a "bug" rather than a "feature request" as the old resolver worked here, but the new resolver does not.

I see at least two workable solutions for this problem, maybe there are other ideas:

Expected behavior

There should be a way to install a package with VCS dependencies offline while version checking the other requirements.

pip version

21.3

How to Reproduce

I've uploaded a very basic example with a descriptive README here: https://github.com/alkasm/test-vcs-offline

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: direct urlDirect URL references (PEP 440, PEP 508, PEP 610)type: feature requestRequest for a new feature

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions