pip icon indicating copy to clipboard operation
pip copied to clipboard

Add Update command

Open G0rocks opened this issue 5 months ago • 1 comments

What's the problem this feature will solve?

When using pip, it is not intuitive how to update/upgrade packages and I just forgot how it is done so I wrote pip in the command line which tells you how to install packages and search for them but not how to update them. Running pip to figure out how to update packages it tells you that you can run pip help for assistance but that shows you the same as when you run pip. If you run pip install --help and read everything it tells you how to update packages but that is quite hidden and it is not intuitive to search for how to update things by running pip install --help

Describe the solution you'd like

I would like a new command for pip to be added which is update and maybe the alias upgrade since some people prefer that. This command would run pip install --upgrade PACKAGE_NAME_HERE and when you run pip it would show up as one of the commands in the list of commands.

Alternative Solutions

If this feature is not what pip wants then another solution would be to modify the description of the install command from Install packages to Install and update packages or similar. Though I do not think this solution is the best solution.

Additional context

I don't have any additional context and since I can not make this feature request without providing any then I would also like to suggest that this feature request form be modified so that the "Additional context" field would be changed from mandatory to optional.

Code of Conduct

G0rocks avatar Jun 14 '25 11:06 G0rocks

This was originally suggested in https://github.com/pypa/pip/issues/59, it was rejected back then because sufficient functionality was added to pip install via --upgrade and --upgrade-strategy.

I don't have a strong opinion on adding a dedicated command, but from my point of view PRs are welcome to add additional documentation.

notatallshaw avatar Jun 15 '25 04:06 notatallshaw

Ok, thanks for showing me that issue. In my opinion it is not about the functionality, rather about the usability and having a dedicated command is more user friendly. The functionality is there, the user friendliness of the funcationality is not there. If I add it, the update command, would it be merged? Asking since I'd rather have the command than the additional documentation.

G0rocks avatar Jun 24 '25 19:06 G0rocks

If I add it, the update command, would it be merged?

For such a user facing feature it would need at least one supportive pip maintainer and no significant objections from any others.

Unfortunately I am not that pip maintainer, while I wouldn't object I'm also not willing to commit to supporting and reviewing a PR. As I think there are design questions and user expectations around a pip upgrade command that would need to be fully thought out. For example, currently pip install --upgrade foo bar can end up downgrading foo or bar, so would this command be identical or would more constraints be put on it?

notatallshaw avatar Jun 24 '25 20:06 notatallshaw

I agree with @notatallshaw, I'm afraid. I am mildly against the idea of an "upgrade" command. Either it's simply an alias for pip install --upgrade, in which case I don't see the point (even if it's slightly more discoverable, I don't think that's enough), or it works differently from pip install --upgrade, in which case we'll end up with a lot of users confused as to why two such similar commands work differently.

pfmoore avatar Jun 24 '25 20:06 pfmoore

Ok. In my opinion then it should be an alias since I don't know that the functionality should be different. Having spoken with a friend of mine it would be more intuitive and user friendly, which in my opinion is enough.

How does it sound to deal with this situation by the issue open until either support or significant objections from a pip maintainer appears and if support comes the implement the command but if significant objection, then instead of adding the upgrade command then we fall back to the backup solution to the problem which is to include more information when running pip on the fact that you can use the install command to update packages?

I suggest this since pfmoore does not seem to have a significant objection and is not supportive of the idea.

G0rocks avatar Jun 24 '25 21:06 G0rocks

Aliasing pip update and pip upgrade is simple and intuitively aligns with countless package managers already using update or upgrade, like pipenv, conda, winget, npm, cargo, gem, choco, brew, dnf, and yum.

One could Google 'upgrade packages pip', but for developers working on flights or when Wi-Fi's unreliable, pip help should help.

Ironically, the top result for that search is a StackOverflow thread with this comment below the first answer:

I been using pip for ages. and since day one I always wonder why they didnt follow the "normal" steps that most apps use. It does not make sense, to "install" since is installed. But "it is what it is" :D – DefToneR Feb 6 at 16:49

EDIT: I agree with notatallshaw regarding the misalignment and pfmoore's point:

even if it's slightly more discoverable, I don't think that's enough

I believe many beginners with only terminal help would see -h as a general option, try pip install -h (as installing feels closest to upgrading), scroll (or use Ctrl+F), and find '-U, --upgrade' in under a minute.

AnthonyHedo avatar Aug 15 '25 15:08 AnthonyHedo

Aliasing pip update and pip upgrade is simple and intuitively aligns with countless package managers already using update or upgrade, like pipenv, conda, winget, npm, cargo, gem, choco, brew, dnf, and yum.

Many of those package manager can often remove unneeded transative dependencies, which pip wouldn't, and pip might downgrade one of those dependencies with an alias of pip install --upgrade.

So I don't agree that aliasing would align with those package managers.

notatallshaw avatar Aug 15 '25 15:08 notatallshaw