Python 2.7 Anaconda Spyder IDE Scitools Movie 编码器='html' 不工作

Python 2.7 Anaconda Spyder IDE Scitools Movie encoder='html' Not Working

现在,我正在尝试在 Anaconda Spyder IDE (运行 Python 2.7) 中制作电影。我的程序顶部有以下导入语句:

from scitools.std import cos, exp, linspace, plot, movie
import time, glob, sys, os

创建用于制作电影的情节后,我使用调用:

movie('tmp_*.png', encoder='html', output_file='tmp_heatwave.html')

尝试制作 .html 格式的电影。在 运行 我的程序之后,我得到错误:

ValueError: encoder must be ['mencoder', 'ffmpeg', 'mpeg_encode', 'ppmtompeg',
'mpeg2enc', 'convert'], not 'html'

为什么会这样?根据我的教科书,A Primer on Scientific Programming with Python, "The HTML format can always be made and played. Hence, this format is the natural choice if problems with other formats occur."

谢谢!

您使用的 scitools 是哪个版本? 0.9.0?

movieclass的源代码中,html是合法的编码器。

...
_legal_encoders = 'convert mencoder ffmpeg mpeg_encode ppmtompeg '\
                  'mpeg2enc html'.split()
_legal_file_types = 'png gif jpg ps eps bmp tif tga pnm'.split()
...

编辑:

检查 scitools.

的版本
>>> import scitools
>>> scitools.__version__
'0.9.0'
>>>