question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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:

  • 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

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
sbidoulcommented, Jun 25, 2022

@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.

1reaction
uranusjrcommented, Jun 24, 2022

I think this is the key statement

offline installations of a package with a VCS URL dependency fails even if the dependency is already installed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Offline installation of a package with a dependency link
I 'd like to add this into a package I am creating, but it seems to cause problems when installing while offline. For...
Read more >
Install package along with all the dependencies offline
while installing, that means the package is not known to the offPC. This occurs due to many reason. such as Personal package maintained...
Read more >
draft-yasskin-wpack-use-cases-00 - IETF Datatracker
Use Cases and Requirements for Web Packages (Internet-Draft, 2019) ... to ship their devices with some web applications pre-installed and usable even if...
Read more >
Nixpkgs 22.11 manual - NixOS
Nix comes with certain defaults about what packages can and cannot be installed, based on a package's metadata. By default, Nix will prevent...
Read more >
Setting Up Python for Machine Learning on Windows
Since the package keras has a lot of dependencies, when you install it, Conda manages to install this big list of packages. It's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found