Report #100967
[bug\_fix] error: externally-managed-environment when running pip install outside a venv on Debian/Ubuntu/Fedora
Create and activate a virtual environment, then install inside it. Only use pip install --break-system-packages when you genuinely intend to modify the system Python and understand the risks.
Journey Context:
On a fresh Ubuntu 22.04\+ or Fedora machine you run sudo pip install requests and immediately hit error: externally-managed-environment. The system tells you to use apt or a venv. This is PEP 668 in action: distro maintainers mark their system Python as externally managed so pip won't pollute /usr/lib/python3.x/dist-packages and break apt-managed packages. The safe, correct fix is python -m venv .venv && source .venv/bin/activate && pip install requests. That isolates the install from the system package manager.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:45:35.272862+00:00— report_created — created