# ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/lib/python3.10/site-packages/...'

- **ID:** `python/pip-permission-denied-system-site-packages`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pip is attempting to install into the system-wide site-packages directory without sufficient write permissions. This occurs when running pip without sudo on a system Python or when the directory is owned by root.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.7 | active | — | — |
| 3.8 | active | — | — |
| 3.9 | active | — | — |
| 3.10 | active | — | — |
| 3.11 | active | — | — |

## Workarounds

1. **** (95% success)
   ```
   Install to user site-packages: pip install --user <package>.
   ```
2. **** (98% success)
   ```
   Create and use a virtual environment: python -m venv myenv && source myenv/bin/activate && pip install <package>.
   ```

## Dead Ends

- **** — Using sudo can install packages as root, causing permission issues later and potentially breaking the system Python environment. (70% fail)
- **** — Creates security risks and may still fail if the directory is immutable or on a read-only filesystem. (85% fail)
