0

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!

sk3644
  • 3
  • 2

1 Answers1

0

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'
>>>
Stephen Lin
  • 4,852
  • 1
  • 13
  • 26
  • I'm not sure how to check the version number. I downloaded scitools onto Spyder using the answer here: http://stackoverflow.com/questions/21368393/importerror-no-module-named-scitools-std. Would that result in html not being a legal encoder? – sk3644 Jan 12 '15 at 03:45
  • @sk3644 You can use scitools.__version__ to check version info. – Stephen Lin Jan 12 '15 at 04:12
  • I'm getting the following: >>> scitools._version_ Traceback (most recent call last): File "", line 1, in NameError: name 'scitools' is not defined >>> scitools.__version__ Traceback (most recent call last): File "", line 1, in NameError: name 'scitools' is not defined – sk3644 Jan 12 '15 at 04:30
  • >>> scitools.__version__ '0.8' – sk3644 Jan 12 '15 at 05:09
  • does that mean .html encoding is not available? If so, how can I get it? – sk3644 Jan 12 '15 at 05:11
  • @sk3644 Here you can get the latest version and re-install it. https://code.google.com/p/scitools/downloads/list – Stephen Lin Jan 12 '15 at 05:20
  • Thanks. I installed the update, however, entering "python setup.py install" on the command-line gives an invalid syntax warning. What command do I need to enter? – sk3644 Jan 12 '15 at 06:07
  • @sk3644 I use the same command as you and it worked. I'm on window 7 64bit. – Stephen Lin Jan 12 '15 at 07:12