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.

2
  • what does matplotlib.__version__ give? Where did you import animation from? Commented Feb 18, 2015 at 3: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. Commented Feb 23, 2015 at 17:34

1 Answer 1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.