error: externally-managed-environment (PEP 668): create a virtual environment

Scope: a base Python installation marked EXTERNALLY-MANAGED by an OS package manager or other distributor and a pip version that honors the PyPA specification. This is a protection boundary, not a pip crash. Identify the exact python and python -m pip first. sys.prefix differing from sys.base_prefix indicates a virtual environment.

For application dependencies, create a project virtual environment with python3 -m venv .venv and invoke .venv/bin/python -m pip (on Windows use the Scripts directory). Activation is optional. For system-wide software, use the OS package manager; for an isolated command-line app, a distributor-provided pipx may fit.

Do not delete the EXTERNALLY-MANAGED marker, use sudo pip, or present --break-system-packages as a normal fix. That flag is an explicit override permitting changes to a protected installation and should be reserved for a disposable, isolated environment where the risk is understood. Current normative specification: https://packaging.python.org/en/latest/specifications/externally-managed-environments/.