简体   繁体   English

Python 2.7 Anaconda Spyder IDE Scitools电影编码器='html'不起作用

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

Right now, I'm trying to create a movie in the Anaconda Spyder IDE (running Python 2.7). 现在,我正在尝试在Anaconda Spyder IDE(运行Python 2.7)中创建电影。 I have the following import statement at the top of my program: 我的程序顶部有以下导入语句:

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

After creating plots to make a movie from, I use the call: 创建剧情制作电影后,我使用以下调用:

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

to try and create a movie in .html format. 尝试创建.html格式的电影。 After running my program, I get the error: 运行程序后,出现错误:

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

Why is this happening? 为什么会这样呢? According to my textbook, 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." 根据我的教科书《 使用Python进行科学编程入门 》所述,“始终可以制作和播放HTML格式。因此,如果出现其他格式的问题,则该格式是自然的选择。”

Thanks! 谢谢!

Which version of scitools are you using? 您正在使用哪个版本的scitools 0.9.0? 0.9.0?

In the source code of movie class, html is in the legal encoder. movie类的源代码中, 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()
...

EDIT: 编辑:

check version of scitools . 检查scitools版本。

>>> import scitools
>>> scitools.__version__
'0.9.0'
>>>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM