📖 ~1 min read
Table of contents
Symptom & Impact
Global pip install fails due to PEP 668 externally managed environment policy.
Environment & Reproduction
Occurs on Ubuntu 24.04 when using system Python for package installs.
python3 -m pip install requests
Root Cause Analysis
System Python is protected to avoid conflicts with apt-managed packages.
Quick Triage
Confirm whether command is running in system interpreter or virtual environment.
which python3
python3 -m pip --version
Step-by-Step Diagnosis
Inspect marker files and pip behavior for active interpreter.
python3 -c 'import sys; print(sys.prefix)'
ls /usr/lib/python3*/EXTERNALLY-MANAGED

Solution – Primary Fix
Use virtual environment for project dependencies and install with pip inside it.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
python3 -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install requests

Solution – Alternative Approaches
Use pipx for standalone CLI apps managed outside system site-packages.
sudo apt install pipx -y
pipx install httpie
Verification & Acceptance Criteria
Packages install successfully in isolated environment without system conflicts.
source .venv/bin/activate
python -m pip list
Rollback Plan
Remove virtual environment and recreate if dependency graph becomes inconsistent.
deactivate 2>/dev/null || true
rm -rf .venv
Prevention & Hardening
Standardize project templates to always include per-project virtual environments.
python3 -m venv .venv
Related Errors & Cross-Refs
Related message is externally-managed-environment with suggestion to use venv.
Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.
View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
PEP 668 and Ubuntu Python packaging policy references.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.