Error Knowledge Base PIP UNKNOWN_COMMAND

ERROR: unknown command "update" (and "upgrade")

pip does not have `update` or `upgrade` subcommands. Upgrading packages is done with `pip install --upgrade ...`.

Affected versions: All pip versions.

What This Error Means

pip does not have update or upgrade subcommands. Upgrading packages is done with pip install --upgrade ....

How to Fix It

  1. To upgrade a package: python -m pip install --upgrade <package>.
  2. To upgrade pip itself: python -m pip install --upgrade pip.
  3. 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

  1. Run python -m pip list --outdated and confirm the package is no longer listed (if it was upgraded).
  2. Re-run your install/upgrade command and confirm pip no longer reports an unknown subcommand.

Manual command discovery

  1. See available commands: python -m pip help.
  2. Check which pip you're using: python -m pip --version.

Common CLI Output

ERROR: unknown command "update"
ERROR: unknown command "upgrade"

How pip commands work

  1. pip uses subcommands like install, uninstall, list, and show.
  2. Package upgrades are performed by re-running install with the --upgrade flag.
  3. 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))

Need help or found a mistake? Contact RepoFlow support for questions.

Join our mailing list