python
config_error
ai_generated
true
error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz...
ID: python/pip-externally-managed-environment
80%Fix Rate
90%Confidence
0Evidence
2024-01-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
PEP 668 marker file EXTERNALLY-MANAGED prevents pip from modifying the system Python environment.
generic中文
PEP 668 标记文件 EXTERNALLY-MANAGED 阻止 pip 修改系统 Python 环境。
Workarounds
-
99% success
`python3 -m venv venv && source venv/bin/activate && pip install foo`.
-
95% success
`pipx install foo` isolates the tool in its own venv.
Dead Ends
Common approaches that don't work:
-
30% fail
Works but risks breaking distro-managed packages; not recommended for production.
-
90% fail
Still blocked by the PEP 668 marker and can corrupt system Python.