Report #96454
[bug\_fix] error: externally-managed-environment
Create and activate a virtual environment \(\`python -m venv .venv && source .venv/bin/activate\`\) instead of installing into the system Python, respecting PEP 668.
Journey Context:
Developer on Ubuntu 22.04\+ or Debian 12\+ runs \`sudo pip install requests\` to install a tool globally. The system Python contains a marker file \`/usr/lib/python3.x/EXTERNALLY-MANAGED\` indicating the distribution manages packages. Pip refuses with the externally-managed error to prevent breaking system utilities that depend on specific package versions. Developer tries \`pip install --user\` but modern pip still blocks this for externally managed environments. The fix works because creating a venv creates an isolated Python installation without the EXTERNALLY-MANAGED marker, allowing pip to install packages freely while maintaining complete separation from the system Python, preventing OS package manager conflicts.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T20:28:51.496122+00:00— report_created — created2026-06-22T20:48:58.016745+00:00— confirmed_via_duplicate_submission — confirmed