# 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-install`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pip is trying to install into a system directory without sufficient permissions.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Create and activate a virtual environment: `python -m venv venv && source venv/bin/activate && pip install foo`.
   ```
2. **** (80% success)
   ```
   If you must install globally, use `pip install --user foo`.
   ```

## Dead Ends

- **** — May work but can cause conflicts; better to use a virtual environment. (30% fail)
- **** — Can break system packages and is discouraged. (60% fail)
