What This Error Means
pip does not have update or upgrade subcommands. Upgrading packages is done with pip install --upgrade ....
How to Fix It
To upgrade a package:python -m pip install --upgrade <package>
To upgrade pip itself:python -m pip install --upgrade pip
To review what would be upgraded:python -m pip list --outdated
Why It Happens
You ran pip update ... or pip upgrade ..., but those are not valid pip subcommands.
You expected pip to behave like an OS package manager.
How to Verify
Run python -m pip list --outdated and confirm the package is no longer listed (if it was upgraded).
Re-run your install/upgrade command and confirm pip no longer reports an unknown subcommand.
Manual command discovery
See available commands:python -m pip help
Check which pip you're using:python -m pip --version
Examples
ERROR: unknown command "update"
ERROR: unknown command "upgrade" How pip commands work
pip uses subcommands like install, uninstall, list, and show.
Package upgrades are performed by re-running install with the --upgrade flag.
Upgrading pip itself is also performed with install --upgrade pip in the active environment.
Prevention Tips
Prefer python -m pip ... so the right pip is used for the active interpreter.
Use pip help <command> to confirm syntax before scripting it.
Use virtual environments so upgrades don't affect system Python.
Where This Can Be Triggered
github.com/pypa/pip/blob/25.3/src/pip/_internal/cli/main_parser.py
pip raises a CommandError with unknown command "..." when the first CLI argument is not a valid subcommand. - GitHub
# the subcommand name
cmd_name = args_else[0]
if cmd_name not in commands_dict:
guess = get_similar_commands(cmd_name)
msg = [f'unknown command "{cmd_name}"']
if guess:
msg.append(f'maybe you meant "{guess}"')
raise CommandError(" - ".join(msg))