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

- **ID:** `python/pip-install-error-permission-denied`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pip lacks write permissions to the target site-packages directory, typically because it is owned by root or another user.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 3.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   pip install --user package
   ```
2. **** (98% success)
   ```
   python3 -m venv myenv && source myenv/bin/activate && pip install package
   ```
3. **** (70% success)
   ```
   sudo chown -R $USER /usr/local/lib/python3.9/site-packages
   ```

## Dead Ends

- **** — This can work but may cause permission issues later and is not recommended for user environments. (50% fail)
- **** — Reinstalling Python does not change directory ownership. (95% fail)
- **** — This may work but can lead to conflicts with system packages. (40% fail)
