# 缓存错误：未找到缓存文件 '/tmp/pytest-of-user/pytest-123/.pytest_cache/v/cache/nodeids'

- **ID:** `python/pytest-cache-miss-error`
- **领域:** python
- **类别:** system_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

pytest 缓存目录丢失或损坏，通常是由于手动删除或并发测试运行。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.9 | active | — | — |
| 3.10 | active | — | — |

## 解决方案

1. **Clear the cache directory and let pytest recreate it.** (95% 成功率)
   ```
   rm -rf .pytest_cache; pytest --cache-clear
   ```
2. **Disable caching with --cache-clear flag each run.** (90% 成功率)
   ```
   pytest --cache-clear
   ```

## 无效尝试

- **Creating an empty cache file manually** — The cache file format is specific; an empty file may cause parsing errors. (80% 失败率)
- **Ignoring the error and continuing** — Pytest may fail to run or report incorrect results without cache. (60% 失败率)
