# WARNING: Cache entry deserialization failed, entry ignored
ERROR: Could not install packages due to an OSError: [Errno 13] Permission denied: '/root/.cache/pip/http-v2/...'

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

## Root Cause

pip is running as a different user than the one that owns the pip cache directory, or the cache was created by root and now a non-root user tries to write to it.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Fix ownership or use a user-local cache:
  sudo chown -R $USER:$USER ~/.cache/pip
Or:
  export PIP_CACHE_DIR=$HOME/.cache/pip-user
  mkdir -p $PIP_CACHE_DIR
  pip install <package>
   ```
2. **** (85% success)
   ```
   Bypass the cache entirely for this install:
  pip install --no-cache-dir <package>
   ```

## Dead Ends

- **** — Running as root fixes the immediate error but pollutes site-packages and can break the system Python. (60% fail)
- **** — World-writable cache is a security risk and may still fail if the parent dir is not writable. (50% fail)
