Skip to content
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

matplotlib window freezing / hanging on close in ipython with OS X #6908

Closed
flipdazed opened this issue Aug 6, 2016 · 11 comments
Closed

matplotlib window freezing / hanging on close in ipython with OS X #6908

flipdazed opened this issue Aug 6, 2016 · 11 comments

Comments

@flipdazed
Copy link

This problem has affected everyone I work with that updated to the currently latest versions below. This only affects ipython plots. The regular python terminal is unaffected by this issue.

Also on posted on StackOverflow: http://stackoverflow.com/q/38801285/4013571

Reproduction

import matplotlib.pyplot as plt
plt.plot()
# manually close the window with `x`

Attempting plt.close() also disables the three native OS X window buttons

Workaround

Us the shortcut for closing ipython and then cancel the exit

^+d
Do you really want to exit ([y]/n)? n

Versions

ipython 5.0.0
matplotlib 1.5.1 
OS X El Capitan Version 10.11.6

Related

@jenshnielsen
Copy link
Member

As far as I know this only affects the OSX backend so as a work around you can use another backend. I.e.

%matplotlib QT4

or

%matplotlib QT5

or

%matplotlib tk

@jenshnielsen
Copy link
Member

On the IPython side ipython/ipython#9659

@jenshnielsen
Copy link
Member

I think the problem is that wait_for_stdin is no longer called automatically with the new prompt-toolkit input hook.

This used to be set as a regular python input hook with

PyOS_InputHook = wait_for_stdin;

@REMeyer
Copy link

REMeyer commented Sep 28, 2016

This affects me as well and can confirm that changing the backend away from MacOSX is a workaround.

@REMeyer
Copy link

REMeyer commented May 7, 2017

Update: The Qt4 backend is now causing incredible lag in the ipython console after plotting is invoked. So it is not as nice of a workaround anymore. Doesn't seem like theres been a solution to this issue yet.

@tacaswell
Copy link
Member

can you try updating ipython? There were some recent changes to how the event loop integration is handled.

@jenshnielsen
Copy link
Member

This was solved for me a long time ago with an update to ipython fixing the event loop integration with prompt-toolkit. @REMeyer If you have a new issue with PyQt5 can you please open a new issue for that

@fabki00
Copy link

fabki00 commented May 11, 2017

Yes, I can confirm that updating ipython fixes this problem.

@gyubeomim
Copy link

I found it.

in my case, I restarted cmd as an administrator then it works!

@tacaswell
Copy link
Member

@tigerk0430 Having to run python as an administrator suggests that your installation is broken. In general doing anything other than administration with elevated permissions is a very bad idea.

@sebma
Copy link

sebma commented Jun 25, 2018

This also works :

%matplotlib auto

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

8 participants