# WARNING: The directory '/home/user/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled.

- **ID:** `python/pip-cache-directory-not-writable`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The pip cache directory was created by another user (often root from a prior sudo pip run) or has restrictive permissions, so pip cannot write to it and disables caching.

## Version Compatibility

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

## Workarounds

1. **** (92% success)
   ```
   Reclaim ownership: sudo chown -R $USER:$USER ~/.cache/pip
   ```
2. **** (85% success)
   ```
   Point the cache elsewhere: pip config set global.cache-dir ~/.cache/pip-user  # or export PIP_CACHE_DIR=~/.cache/pip-user
   ```

## Dead Ends

- **** — Silences the warning by skipping cache entirely but leaves the root-owned directory in place; every future install re-warns. (50% fail)
- **** — Makes root the owner again, guaranteeing the non-root user still cannot write; the warning persists. (90% fail)
