Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Problem with importing matplotlib.animation #5347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
xRagnorokx opened this issue Oct 29, 2015 · 4 comments
Closed

Problem with importing matplotlib.animation #5347

xRagnorokx opened this issue Oct 29, 2015 · 4 comments

Comments

@xRagnorokx
Copy link

Hi all,

I have been having issues with importing matplotlib.animation. In either python or ipython calling the following command hangs forever:

from matplotlib import animation

Import matplotlib, from matplotlib import pyplot etc work fine but obviously do not let me access animation. Upon a cntrl+c I receive the following error messages:

Traceback (most recent call last):
  File "3D-v1.py", line 4, in <module>
    from matplotlib import animation
  File "/Users/---/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 541, in <module>
    class ImageMagickWriter(MovieWriter, ImageMagickBase):
  File "/Users/---/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 66, in wrapper
    if writerClass.isAvailable():
  File "/Users/---/anaconda/lib/python2.7/site-packages/matplotlib/animation.py", line 267, in isAvailable
    p.communicate()
  File "/Users/---/anaconda/lib/python2.7/subprocess.py", line 799, in communicate
    return self._communicate(input)
  File "/Users/---/anaconda/lib/python2.7/subprocess.py", line 1409, in _communicate
    stdout, stderr = self._communicate_with_poll(input)
  File "/Users/---/anaconda/lib/python2.7/subprocess.py", line 1463, in _communicate_with_poll
    ready = poller.poll()

Build Info:
OS: Mac OS X Lion 10.7.5
Anaconda Version: Original version I had this issue on is unknown but problem persisted on a new install of latest Anaconda python 2.7 and python 3 versions (Anaconda-2.3.0-MacOSX-x86_64.pkg and Anaconda3-2.3.0-MacOSX-x86_64.pkg from https://www.continuum.io/downloads. )

I also reproduced the issue on a separate mac book using a identical new build.

I cannot find any information online about this issue other than a similar problem with importing matplotlib.pyplot. #2919. I tried the steps suggested on the off chance that they would help but they had no effect.

Upon trialing the import on several colleagues Mac books I found that only those running an older version of Anaconda had no issue. Downgrading my machine to Anaconda 2.0.1. (Python 2.7.7 | Anaconda 2.0.1 (x86_64) | (default, Jun 2 2014, 12:48:16) seems to fix the issue.

Apologies if this is the wrong place to post this or if the bug turns out to be in Anaconda or a unique issue with my build / laptop!

@tacaswell
Copy link
Member

This looks like it is dying trying to reach out to check if an external command line tool exists.

Your OSX is also pretty old (4years), I wonder if we are running into issues with changes to the OS?

@tacaswell tacaswell added this to the next bug fix release (2.0.1) milestone Oct 29, 2015
@mdboom
Copy link
Member

mdboom commented Oct 29, 2015

Can you try putting the following in a Python script and see if it works? It might raise an exception, but it shouldn't hang.

            import subprocess
            p = subprocess.Popen('/bin/bash',
                             shell=False,
                             stdout=subprocess.PIPE,
                             stderr=subprocess.PIPE,
                             creationflags=0)
            p.communicate()

If that fails for you, then it's a problem in Python itself, not matplotlib, and you should report to Anaconda.

@xRagnorokx
Copy link
Author

I tested the above suggested code for a few minutes and it too seems to hang on the latest Anaconda versions. I will open a bug report with them and link it to this page.

Thank you for your help!

PS: Yes my OS X is ancient but this close to the end of my thesis I just don't dare to mess with it!

@mdboom
Copy link
Member

mdboom commented Oct 30, 2015

You're welcome. I'm closing this just to keep things neat.

@mdboom mdboom closed this as completed Oct 30, 2015
@QuLogic QuLogic removed this from the next bug fix release (2.0.1) milestone Oct 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants