-
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
Take installed packages into account when upgrading another package #9094
Comments
Awesome. Looks like a supermajority of the folks we've asked in the survey about "should pip take installed packages into account" responded that we should. We'd likely want to do this at a later date, sometime in 2021. IF @pypa/pip-committers (specifically, @pfmoore or @uranusjr) want to try to make this happen sooner, I'm not opposed. ;) |
It looks like I didn't catch the bus when the user survey was on going. But I also agree with Will we be just getting a warning that has |
I’d expect the command to exit with non-zero since the message says cannot. |
Just adding my +1 here in favor of the same option as the 71.7% in your survey. I prefer that pip does not install anything and exits (with non-zero exit code) if proceeding would create an inconsistent environment. @nlhkabu , +1 on your suggested error message also. |
Like @miguelbalmeida, I also support the users proposal: "Install nothing. Show an error explaining that the upgrade would cause incompatibilities." @pypa/pip-committers please don't let forget this proposal. Thanks! |
A PR implementing this would, of course, be welcome. But be aware, it's not a simple change (that's why nothing has been done on it yet!) |
I don't think this would be something that we could jump to a PR for directly! That said, we very much would appreciate having someone come and champion this. :) This is a multi-faceted change, with a bunch of interesting design considerations to make in addition to trying to actually implement the logical change here. Work on this would very much be welcome here, and please do chat with us if you're interested in driving this! |
FYI, a simple workaround to get OPs behavior is something like this:
|
Or, in a single line (if your shell permits, the line below works on bash):
Though it must be said that this workaround prevents installation of valid package combinations. For instance, it prevents the installation of That's because this workarounds tells pip to assume the currently installed versions as immutable, rather than checking the actual constraints required by the currently installed packages. |
Yes, this takes into account what is installed, not what you asked to install. For the latter you need a higher level package manager than Pip, there are fortunately a growing number of them. Side note: I actually roll my own as I find all of them more complex for basic stuff than I would like. It's a simple script that rebuilds a vritual evironment when you change a requirements file. |
In #7744 we have decided to warn users when pip creates a dependency conflict when upgrading another package.
This issue is a proposal to change this behavior. This proposal is supported by user research, a summary of which will shortly be published on pip's docs.
What's the problem this feature will solve?
Currently, when a user asks pip to upgrade a package, it does this without considering what other packages are already installed. This can mean that pip can cause a dependency conflict.
This scenario (used in our user research) summarises the problem well:
Describe the solution you'd like
Pip should:
This reflects the most popular response to our research (71.7% of respondents) who said that pip should "Install nothing. Show an error explaining that the upgrade would cause incompatibilities."
Additional context
Example error message (happy to iterate on this as needed!)
The text was updated successfully, but these errors were encountered: