python
system_error
ai_generated
true
error: [Errno 13] Permission denied: '/usr/local/lib/python3.11/site-packages/mypkg-1.0.dist-info/METADATA'
ID: python/pip-egg-info-permission-denied
80%Fix Rate
88%Confidence
0Evidence
2024-09-21First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
pip is installing into a system site-packages directory owned by root without sufficient privileges.
generic中文
pip 正在安装到由 root 拥有的系统 site-packages 目录,但没有足够的权限。
Workarounds
-
99% success
python3 -m venv .venv source .venv/bin/activate pip install mypkg
-
90% success
python3 -m pip install --user mypkg
Dead Ends
Common approaches that don't work:
-
40% fail
Installing as root pollutes the system Python and can break OS tooling; also may still fail on immutable dirs.
-
70% fail
Weakens system security and can break other tools relying on permissions.
-
85% fail
--user is ignored when running as root, so it still targets system site-packages.