-
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
Pip continues installing despite conflicting dependencies #8104
Comments
Hi there, you are here just in time to try out v20.1b1 which has a more proper dependency resolver that should be able the conflict gracefully (GH-8099). The legacy resolver, however, is trying its best, and I believe the reason for it is to make it possible to install/upgrade a new package even if that breaks other ones. I'm truly sorry for your inconvenience. |
This is good fallback behavior. But I do not get why this is the default behavior. Surely a program should just exit with non-zero if things are wrong? Unless some
I will check it out, but I see that it won't be used by default for quite some time. So this won't solve the problem in a lot of CI and other environments. The workaround is appreciated though 👍 . |
No problem. Thanks for the info! |
Mostly, it's historical and it's a bug. It's just that we're not going to fix it in the old resolver at this point, as the new one is nearly ready and we plan on not having this issue in the new resolver in the first place 🙂 |
Thanks for the explanation 😊 I think I've been spreading inaccurate information for quite a while. |
@pfmoore Thanks for the context. I am curious how the new resolver will work out. |
I doubt it. The whole question is very complex. The current behaviour of spotting that we've hit a conflict and having no means of backing out and trying alternatives is part of why the old resolver needs to be replaced. In itself, that's just "yeah, it's broken but to fix it needs a rewrite" that is what started the "pip needs a new resolver" process. The part about reporting the conflict and continuing is more or less "by design" because there's not really a better option (crashing out leaves people with no good way to address the issue, and in too many cases there is a good set of packages to install, it's just that pip can't find them). It's bad, but the available alternatives in the old resolver don't seem much better. The bit where we report "ERROR" but then return an exit status of 0 is hard to justify, so I'd class that as a bug. But I reserve the right to fix it by changing the text to "WARNING" 🙂 In the new resolver, we will fix this, but by various means:
As yet, we have no real view on how much control we'll give to the user to override in the case of conflicts. That's a whole other area that needs more experience and user feedback (we have research going on to help inform that process). So... not so much inaccurate information as "way more complicated than can be summarised in a quick comment" 🙂 |
In the mean time, as a workaround: pip install -r conflicting-requirements.txt
pip check
|
Applying pypa/pip#8104 (comment) everywhere to make sure builds do not include incompatible dependencies.
Thanks for filing this issue @rhpvorderman! You're hitting #988 -- an issue that's on pip's donor funded roadmap for this year. I see that both Basically, this specific issue will be fixed as part of #988. I'm going to go ahead and close this as a duplicate of that issue now, since there's no reason to tracking the same problem in multiple issues. :) |
Thanks @pradyunsg ! |
Environment
Description
if a package install leads to conflicting packages in the environment pip continues installing and happily exits with exit code 0: everything is fine!
If you then run of the package everything breaks because of the interface of dependencies not being there, or worse continues without error and output wrong results!
Expected behavior
Two options:
How to Reproduce
virtualenv --python python3 conflicting-env
source conflicting-env/bin/activate
pip install pytest-workflow==1.3.0 'pytest<5'
pytest
and watch how everything breaks down.Output
Note how pip does notice that it installs conflicting packages, but then continues anyway. In automated environments this can lead to lots of problems. Automated scripts will not notice something is amiss and will crash or much worse: deliver faulty data.
The text was updated successfully, but these errors were encountered: