# ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/usr/local/lib/python3.11/site-packages/foo'
Consider using the `--user` option or check the permissions.

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

## Root Cause

pip is writing to a system-wide site-packages that the current user cannot modify, usually because the interpreter is owned by root.

## Version Compatibility

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

## Workarounds

1. **** (85% success)
   ```
   Install for the current user: `pip install --user foo`, then ensure `~/.local/bin` is on PATH.
   ```
2. **** (95% success)
   ```
   Use a virtual environment: `python -m venv .venv && source .venv/bin/activate && pip install foo`.
   ```

## Dead Ends

- **** — Installs system-wide, can break OS packages, and pollutes root's environment. (40% fail)
- **** — Security risk and may be reset by package manager upgrades. (70% fail)
