# findfont: 未找到字体族 'Arial'。

- **ID:** `python/matplotlib-findfont-cache-stale`
- **领域:** python
- **类别:** config_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

请求的字体未安装在系统上，或安装新字体后 matplotlib 的字体缓存已过期。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 3.x | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   sudo apt-get install -y fonts-liberation
rm -rf ~/.cache/matplotlib
python -c "import matplotlib.font_manager as fm; fm._load_fontmanager(try_read_cache=False)"
   ```
2. **** (95% 成功率)
   ```
   import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'DejaVu Sans'  # shipped with matplotlib
   ```

## 无效尝试

- **** — The font file is genuinely absent; naming it does not create it. (93% 失败率)
- **** — Upgrading matplotlib does not install OS-level font packages. (88% 失败率)
