# ValueError: cache directory is not writable: /path/to/.pytest_cache

- **ID:** `python/pytest-cache-error`
- **Domain:** python
- **Category:** system_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

pytest的缓存目录权限不足或路径不存在，导致无法写入缓存。

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 7.x | active | — | — |
| 8.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   chmod -R u+w .pytest_cache
   ```
2. **** (85% success)
   ```
   pytest --cache-clear
   ```

## Dead Ends

- **** — 删除后pytest会尝试重新创建，但权限问题依然存在 (60% fail)
- **** — sudo可能改变权限，但不推荐，且可能引发其他问题 (50% fail)
