0

Possible Duplicate:
matplotlib.animation error - The system cannot find the file specified

I'm trying to use the animation class in python and have a problem with the save.animation function. Other questions have had the poster add an application called ffmpeg.exe to the python path to solve the problem.

Unfortunately, I really don't understand what it means to "add something to the python path" and can't figure it out from searching online.

Would anyone like to enlighten me? It would be much appreciated!

The problem is that when running my code the line:

anim.save('HAMILTONIAN.mp4',fps=5, codec=None, clear_temp=True, 
            frame_prefix='_tmp') 

produces the error:

Traceback (most recent call last):

  File "Z:\desktop\Project\bhmqntm-code\HamiltonianMovie(points_reducedtsegs).py", line 75, in <module>
    anim.save('HAMILTONIAN.mp4',fps=5, codec=None, clear_temp=True, frame_prefix='_tmp')

  File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 127, in save
    self._make_movie(filename, fps, codec, frame_prefix)

  File "C:\Python27\lib\site-packages\matplotlib\animation.py", line 164, in _make_movie
    stdout=PIPE, stderr=PIPE)

  File "C:\Python27\lib\subprocess.py", line 679, in __init__
    errread, errwrite)

  File "C:\Python27\lib\subprocess.py", line 893, in _execute_child
    startupinfo)

WindowsError: [Error 2] The system cannot find the file specified
Community
  • 1
  • 1
user2023134
  • 141
  • 1
  • 1
  • 4
  • 1
    You are referring to two different things actually. The `PYTHONPATH` is where python will look for modules to be imported. The `PATH` is where a command shell will look for executables (like ffmpeg.exe). Can you provide a bit more information regarding the nature of your problem? – jdi Dec 12 '12 at 02:57
  • Where is `save.animation` coming from? – Thomas Orozco Dec 12 '12 at 03:05
  • 1
    To sum up that duplicate question... Do you have ffmpeg installed? If so, then make sure the location containing `ffmpeg.exe` is in your windows PATH variable. You can google how to update the windows PATH environment variable. – jdi Dec 12 '12 at 03:50
  • I know it's a very similar to that one sorry, I just can't figure out how to sort out the ffmpeg.exe location problem and found the google results for it confusing. – user2023134 Dec 12 '12 at 04:37
  • Ok windows PATH is updated but unfortunately I still get the error and no saved file. Do I maybe also need to change something with the PYTHONPATH? – user2023134 Dec 12 '12 at 05:04
  • Got it! :D It turns out for vista you need to restart your computer before changing the PATH variable takes effect. Thanks so much for the help, I really appreciate it. – user2023134 Dec 12 '12 at 05:45

0 Answers0