RuntimeError:Matplotlib动画中没有MovieWriters [英] RuntimeError: No MovieWriters available in Matplotlib animation
问题描述
我遇到的问题是类似于以下示例的代码: https://matplotlib.org/examples/animation/basic_example_writer.html
The problem I am getting is in code similar to this example: https://matplotlib.org/examples/animation/basic_example_writer.html
错误:
运行时错误:在上面的示例中,Writer = animation.writers['ffmpeg']
处没有可用的MovieWriters .
RuntimeError: No MovieWriters available occurs at Writer = animation.writers['ffmpeg']
in the example above.
我正在使用Mac,已经使用brew安装了ffmpeg,甚至使用conda进行了安装,即使我没有为该特定代码使用anaconda.
I am using mac, I have installed ffmpeg using brew, and even installed it with conda even though I am not using anaconda for this particular code.
我肯定它已安装-我已经在终端中使用它来更改文件,但是它在程序中不起作用.
I am positive that it is installed - I have used it in terminal to change files but it is not working within the program.
谢谢!
推荐答案
尝试像
import matplotlib.pyplot as plt
plt.rcParams['animation.ffmpeg_path'] = '/usr/local/bin/ffmpeg'
您必须将这些代码行放在脚本的开头,然后使用动画Writer
.
You have to put these code lines at the beginning of a script and then use animation Writer
.
这篇关于RuntimeError:Matplotlib动画中没有MovieWriters的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!