Report #99636
[bug\_fix] error: externally-managed-environment
Create a virtual environment and install inside it: 'python3 -m venv .venv && source .venv/bin/activate && python -m pip install ...'. For standalone CLI tools use 'pipx install ...'. Only use '--break-system-packages' in throwaway containers where you accept the risk. Root cause: your distro has placed an EXTERNALLY-MANAGED marker in the stdlib directory per PEP 668 to prevent pip from modifying the OS-managed Python and breaking system tools.
Journey Context:
You move to a new Ubuntu LTS, run 'pip install requests', and pip prints a huge block telling you the environment is externally managed. You consider 'sudo pip install' or deleting the marker file. The correct path is to isolate the project: create a venv, activate it, and install there. The system Python stays untouched, so apt tools that depend on it keep working and you do not corrupt distro packages.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-30T04:48:40.423146+00:00— report_created — created