[IPython-dev] %matplotlib qt hangs notebook

Fangohr H. H.FANGOHR at soton.ac.uk
Fri Sep 25 04:30:49 EDT 2015

Hi Vasco,

> On 25 Sep 2015, at 08:54, Vasco <vasco+python at tenner.nl> wrote:
> Dear,
> sometimes when I run %matplotlib qt in the ipython notebook (v4), it is indicated that the cell is executed and that the kernel is not busy. However, the next cell cannot be executed: there appears a *, as should be, but there is no output, the * remains, but the kernel does not look busy.
> This mainly happens when I run the second cell, while the %matplotlib qt command is not finished yet.
> Is this a known problem? How can I diagnose what is going on? I tried to start jupyter with --debug flag, but it does not give any errors or messages relating the notebook/kernel that is giving problems.
> This problem occurs at both a windowsxp machine with the newest python3 version from anaconda, as on a ubuntu machine, with
> * python '3.4.0 (default, Jun 19 2015, 14:20:21) \n[GCC 4.8.2]'
> * matplotlib 1.3.1
> Both with ipython4 from pypi

I am not sure I follow all the details of your description, but I see similar behaviour on a OS X: when you request pop up windows from matplotlib via “%matplotlib qt”, the window with the plot appears after you issue the pylon.show() or corresponding show() command. It so turns out that very often the window appears behind the other windows on the screen (i.e. behind the browser window in which the notebook runs), and thus I can’t see it easily. Only when I minimise the windows (F3 on the Mac), I can see the figure window. What happens is that this figure window has control of the process, thus the [*] in the cell containing the show() command. When I close the figure window, the [*] disappears from the cell and control goes back to the IPython notebook.

This may be what you see, or you may have another problem. If the [*] appears already when you enter only “%matplotlib qt”, then your problem is likely to be different. 

[I generally prefer the “%matplotlib inline” setting which includes figures inline.]

Best wishes,


> Kind regards,
> Vasco
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> https://mail.scipy.org/mailman/listinfo/ipython-dev

More information about the IPython-dev mailing list