Search code examples
pythonhtmlpython-2.7spyderencoder

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). 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. 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."

Thanks!


Solution

  • Which version of scitools are you using? 0.9.0?

    In the source code of movie class, html is in the legal encoder.

    ...
    _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.

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