-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extremely slow dependency resolution with circular graph of dependencies #12210
Comments
So indeed this does fail to solve (albeit very slowly, it takes > 30 mins on my machine). However the error message is also very confusing. I can't work out what the actual root problem is from this message:
|
Another piece of data: with the legacy resolver, it solves in < 1 minute, having selected |
Does the legacy resolver install a valid environment? I.e. what is the output of When there are no valid solutions and a large dependency graph it can take the resolver a long time to prove this. There might be some optimization available, I'll take a look at this specific example, but it might just not be possible to prove there's no solution without checking 1000s of packages and billions of combinations. The legacy resolver in this scenario installs a broken environment, and so does not need to check all possibilities. |
It doesn't seem to be broken? I get: $ pip check
No broken requirements found. |
Even if this environment can't be solved, I would love to help with making the error message more informative. It's been a pain point for me. If we could get it to print out the exact conflict in this case that would be wonderful. |
Error messages are difficult for dependencies but I'm sure the Pip maintainers would accept PRs for better error messages. In this case I suspect the issues is to do with the extra (transitive) dependency, which are known to produce not great error messages. It's also potentially the reason why pip check is passing, as if the pip legacy resolver breaks the extra requirement but not the underlying packages then pip check would pass even if the install was inconsistent with the requirements. I'll try and reproduce this, and test a few things, after work today when I have some time. |
|
Okay, so I am able to reproduce the 1. There is a bug in the deprecated legacy resolverOne thing you will notice with the logs of the legacy resolver is it never includes It appears by
While this is a bug I don't imagine this will be fixed by the Pip maintainers 2. The resolver somewhat struggles with extrasThe resolver does not understand that Fortunately you are not the first person to experience this, this is previously discussed in #11924 and a PR exists to fix this in #12095 While on my computer running with default Pip I still get a ResolutionImpossible in ~1-2 mins, with the branch in #12095 it resolves to the following much cleaner error in seconds:
This is therefore a duplicate of #11924. |
Wow, this is amazing info thank you. If the PR you mention improves the error message and the solving speed then I think it would resolve this issue. Happy to close as a duplicate if appropriate. |
Also FYI using the branch from #12095 I was able to quickly produce a working set of requirements (by removing the version constraint on
|
I'll consolidate this into #11924. Thanks for that investigation @notatallshaw! ^.^ |
Description
I have a scenario where I need to depend on 3 packages, one of which depends on the two others:
When I try to install all these packages simultaneously,
pip
seems to struggle with the installation, but if I remove one of the nodes of the graph (thereby removing the cycle), it has no issue. Edit: actually I realise that this isn't a cycle, but I don't know how else to describe this graph pattern.Expected behavior
In this case I expect to be able to solve the dependency tree. It may be the case that this tree of dependencies has no solution, but even if that is the case, I would hope that pip could realise it much faster than it does now.
pip version
23.2.1
Python version
3.9.12
OS
MacOS Monterey (12.6)
How to Reproduce
To obtain the infinite or very slow package solving, run this:
pip install 'aicsimageio==4.9.1' 'napari-aicsimageio==0.7.2' 'napari==0.4.18'
.Note that, if you instead install two of the above three packages,
pip
has barely any trouble, and installs in a minute or so.Output
The full log is extremely long, but I get lots of lines like the following:
Code of Conduct
The text was updated successfully, but these errors were encountered: