python
system_error
ai_generated
true
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'
ID: python/matplotlib-animation-ffmpeg-missing
80%Fix Rate
89%Confidence
0Evidence
2024-07-08First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 3.x | active | — | — | — |
Root Cause
matplotlib.animation.FuncAnimation.save() defaults to ffmpeg writer, but ffmpeg is not on PATH.
generic中文
matplotlib.animation.FuncAnimation.save() 默认使用 ffmpeg 写入器,但 ffmpeg 不在 PATH 中。
Workarounds
-
95% success
sudo apt-get install -y ffmpeg # or: conda install -c conda-forge ffmpeg
-
90% success
from matplotlib.animation import PillowWriter ani.save('anim.gif', writer=PillowWriter(fps=20))
Dead Ends
Common approaches that don't work:
-
92% fail
The PyPI 'ffmpeg' package is a Python wrapper; it does not provide the ffmpeg binary.
-
90% fail
The writer is already ffmpeg; the binary is what's missing.