0

Trying to save a gif on Jupyter but keep getting the error message:

ValueError: Cannot save animation: no writers are available. Please install mencoder or ffmpeg to save animations.

I have tried to install ffmpeg but this hasn't cleared my error message.

This is the code I have written.

import matplotlib
import matplotlib.pyplot as plt

matplotlib.use('Agg')
anim.save('animation.gif', writer='imagemagick', fps = 30)
Emm
  • 2,367
  • 3
  • 24
  • 50

1 Answers1

0

Assuming imagemagick was installed correctly, it's possible you simply need to point the rcParam animation.convert_path to the convert executable, i.e.

rcParam['animation.convert_path'] = '/usr/bin/convert'

Note that this must be set prior to trying to save the animation. In order to make the change permanent you can modify the matplotlibrc file, the path to which can be retrieved via

matplotlib.matplotlib_fname()

you would simply need to append

animation.convert_path: /usr/bin/convert

Some other answers you may find useful: 1 2

William Miller
  • 9,839
  • 3
  • 25
  • 46