Report #74047
[bug\_fix] ExternallyManagedEnvironment when running pip install system-wide
Create and activate a virtual environment \(python3 -m venv .venv\) and install packages there instead of using system pip.
Journey Context:
Developer on Ubuntu 22.04 runs \`pip install requests\` and gets "error: externally-managed-environment". They try sudo, same error. They find advice online to use \`--break-system-packages\` but worry about breaking system tools. They check \`/usr/lib/python3.11/EXTERNALLY-MANAGED\` and realize PEP 668 prevents pip from touching system python to avoid conflicts with apt packages. They create a venv with \`python3 -m venv .venv\`, activate it, and pip install works. Root cause is the distribution marking system Python as externally managed via the EXTERNALLY-MANAGED file.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T06:52:57.608036+00:00— report_created — created