python
system_error
ai_generated
true
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/site-packages'
ID: python/pip-install-permission-denied-site-packages
80%Fix Rate
88%Confidence
0Evidence
2024-04-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
The user lacks write permissions to the system-wide site-packages directory.
generic中文
用户对系统范围的 site-packages 目录没有写权限。
Workarounds
-
98% success
python -m venv myenv; source myenv/bin/activate; pip install package
-
85% success
pip install --user package
Dead Ends
Common approaches that don't work:
-
60% fail
May cause permission issues for other users and is not recommended in virtualenvs.
-
40% fail
Installs to user site-packages, which may not be in PATH or may conflict with system packages.