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
Inconsistent %matplotlib qt behavior #4997
Comments
It's worth noting that the problem can also be seen from the qt console, so it's not notebook-specific. |
I experienced a similar behavior trying to open a Qt dialog. I normally use "inline" but I need to switch to "qt" mode to launch the dialog (otherwise the dialog does not launch). A while ago I asked a SO question that apparently got unnoticed: I also made a notebook that reproduces the problem: |
I can confirm this also happens using Matplotlib on current master. |
This is because the kernel eventloop integration happens in between iterations (cell executions), so a blocking call is made between telling the kernel to hook up with the eventloop, and actually handing off control. I think we can improve how that's handled, I will look into it. |
Great, thanks @minrk |
Can you give #5077 a try? I think it was a pretty basic problem of having two eventloops going at once:
The change I made in #5077 is to just flush any pending sends when the GUI eventloop is entered, so there shouldn't be any messages waiting in tornado's queue. |
@fperez can you review this fix? |
Yup, doing so now... |
Flush replies when entering an eventloop. This avoids possible hangs when the GUI eventloop prevents queued replies from being sent. Closes #4997.
I updated to 2.0. However the kernel still crashes running the example notebook linked above. |
Flush replies when entering an eventloop. This avoids possible hangs when the GUI eventloop prevents queued replies from being sent. Closes ipython#4997.
Evaluating a cell beginning with the
%matplotlib qt
magic and immediately following with commands to Mayavi cause the kernel to freeze. The Mayavi window opens correctly and responds to user input, but the cell never yields control back to the user.If instead, a cell containing
%matplotlib qt
in isolation is run, it returns without issue. Subsequently issuing Mayavi commands in a separate cell work as expected, returning immediately.This notebook gives a minimal demonstration of the problem, as well as some further diagnostic information.
Note that the problem is confirmed to exist on OS X on a recent master and on Linux (thanks @fperez)
Note that this bug only occurs the first time the
%matplotlib qt
command is executed - subsequent calls (e.g. after switching to%matplotlib inline
and back to%matplotlib qt
with commands immediately following in the qt enabled cell) work fine.The text was updated successfully, but these errors were encountered: