python
system_error
ai_generated
true
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/lib/python3.11/site-packages/foo'
ID: python/pip-permission-denied-site-packages
80%Fix Rate
88%Confidence
0Evidence
2024-11-09First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
Installing into a system-wide site-packages without write permission.
generic中文
在没有写权限的情况下向系统级 site-packages 安装。
Workarounds
-
95% success
python -m venv .venv && source .venv/bin/activate && pip install foo
-
90% success
pip install --user foo
Dead Ends
Common approaches that don't work:
-
50% fail
Mixes root-owned files into user environment, causing future permission errors and security risks.
-
80% fail
Weakens system security and does not address root cause.