Cannot install package offline with VCS dependencies, even if they are pre-installed
See original GitHub issueDescription
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:
- add a flag to not eagerly install vcs-specified dependencies if they’re already installed
- add a command to explicitly check against version requirements (e.g. check your environment meets the current packages) (potentially similar to a
pip resolve
https://github.com/pypa/pip/issues/7819)
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
- I agree to follow the PSF Code of Conduct.
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (7 by maintainers)
Top GitHub Comments
@alkasm I tested #10564 which, in its current implementation, does not address your use case of off-line re-installation. It does not reinstall, as advertised, but it still executes a git clone to prepare metadata, which fails if off-line.
I think this is the key statement