0

I'm trying to animate a graph with Matplotlib, something which I've done on a previous system. My code, however, seems to fail with my current setup.

Here's the problem:

Writer = animation.writers['ffmpeg']

Traceback (most recent call last): File "/Users/oliversanders/Documents/Code/PyCharm/plottools/animationTest.py", line 17, in Writer = animation.writers['ffmpeg'] AttributeError: 'module' object has no attribute 'writers'

Or alternatively:

mywriter = animation.FFMpegWriter(fps=15)

Traceback (most recent call last): File "/Users/oliversanders/Documents/Code/PyCharm/plottools/animatedPointPlotter.py", line 101, in mywriter = animation.FFMpegWriter(fps=15) AttributeError: 'module' object has no attribute 'FFMpegWriter'

I've just re-installed matplotlib (1.4.2) and ffmpeg (2.5.3) for good measure. I've also deleted all .pyc files from matplotlib's directory to make sure they aren't messing anything up.

I've looked around but been unable to find a solution. See also: Using FFmpeg and IPython, What could be wrong in saving the following animation in Python?.

Thanks in advance.

Community
  • 1
  • 1
osnoz
  • 1,127
  • 1
  • 11
  • 16
  • what does `matplotlib.__version__` give? Where did you import `animation` from? – tacaswell Feb 18 '15 at 03:52
  • '__version__' provides me with a different result when run from terminal as in my IDE, hence the problem. I hadn't though to check that, thanks. – osnoz Feb 23 '15 at 17:34

1 Answers1

2

Turned out to be a stupid and simple problem. I was using pycharm (IDE) which was importing an outdated version of matplotlib from an incorrect directory (incidentally something I'm yet to fix). Thanks to tcaswell for prompting me to check where the module was imported from (module.__file__).

osnoz
  • 1,127
  • 1
  • 11
  • 16