# FileNotFoundError: [Errno 2] 没有这样的文件或目录: 'ffmpeg'

- **ID:** `python/matplotlib-animation-ffmpeg-missing`
- **领域:** python
- **类别:** system_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

matplotlib.animation.FuncAnimation.save() 默认使用 ffmpeg 写入器，但 ffmpeg 不在 PATH 中。

## 版本兼容性

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

## 解决方案

1. **** (95% 成功率)
   ```
   sudo apt-get install -y ffmpeg
# or: conda install -c conda-forge ffmpeg
   ```
2. **** (90% 成功率)
   ```
   from matplotlib.animation import PillowWriter
ani.save('anim.gif', writer=PillowWriter(fps=20))
   ```

## 无效尝试

- **** — The PyPI 'ffmpeg' package is a Python wrapper; it does not provide the ffmpeg binary. (92% 失败率)
- **** — The writer is already ffmpeg; the binary is what's missing. (90% 失败率)
