# ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/root/.cache/pip'

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

## Root Cause

pip is running as a user without write access to the cache directory, often because the cache was created by root or another user.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   pip install --cache-dir /tmp/pip-cache package
   ```
2. **** (90% success)
   ```
   sudo chown -R $USER:$USER ~/.cache/pip
   ```

## Dead Ends

- **** — Installs packages system-wide and may cause permission issues later; not recommended in virtualenvs. (70% fail)
- **** — If you lack permission to delete it, the error persists; also loses cache benefits. (60% fail)
