Use of qt kills kernel all the time

2,629 views
Skip to first unread message

Sandbo Chang

unread,
Feb 8, 2016, 12:50:42 PM2/8/16
to Project Jupyter
Hello,

I am new to Jupyter notebook, recently I got a fresh install of Fedora 23 and Jupyter Notebook and have them running.
Everything looks good, with various packages like numpy scipy and matplotlib working well.

Except that whenever I tried to use qt to plot anything, 
by running just this line
%matplotlib qt
it immediate kills the kernel and it has to restart.
Plotting using %matplotlib inline is working perfectly well.

I already tried to install the packages I am aware of being related, like pyqt4 and pyqt5, also python3-matplotlib-qt4 and python3-matplotlib-qt5, but I was out of luck.

Would you have any ideas?

Thomas Kluyver

unread,
Feb 8, 2016, 12:54:33 PM2/8/16
to Project Jupyter
Do you see any error messages in the terminal where you started the notebook when this happens?

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/5ae5b146-59f9-4014-80e4-188dccb57c0d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sandbo Chang

unread,
Feb 8, 2016, 1:02:06 PM2/8/16
to Project Jupyter
A message pops up and say "the kernel has died, it will be restarted" something like it.
Then I am left with a new kernel and have to run everything from fresh, but then if I import matplotlib, and call the same commend, %matplotlib qt, it is killed again.
No other error messages could be seen.

Also, I was trying to see what backend was being used when qt is called, by using 
import matplotlib.pyplot as plt
plt
.get_backend()
It showed
'Qt5Agg'
Would there be anything I forgot to install?

Thomas Kluyver

unread,
Feb 8, 2016, 1:20:21 PM2/8/16
to Project Jupyter
That doesn't sound like anything that's missing - a missing package will normally produce an error message, not crash the kernel.

1. Can you do %matplotlib qt using IPython in a terminal (i.e. from a terminal, run the command 'ipython')?
2. Do you see the same crash if you do '%gui qt' in a notebook?

Sandbo Chang

unread,
Feb 8, 2016, 4:26:15 PM2/8/16
to Project Jupyter
Thanks for getting back to me,

1. Running that from a SSH session (the server is now remote),
it simply crashed the iPython and threw me out of the iPython session and returned me to the terminal

2. Running %gui qt
The same happened, it popped up the same message telling me the kernel has died.

Kernel Restarting

The kernel appears to have died. It will restart automatically.

Thomas Kluyver

unread,
Feb 8, 2016, 4:36:11 PM2/8/16
to Project Jupyter
Hang on, this is on a server? The Qt backend tries to create a new window to show the plot. It's only intended for local use, and it won't work on a server unless you use something like X over ssh.

SSHing into a remote machine, I see something similar - IPython crashes with the error "cannot connect to X server" when I try %gui qt. Is that what you see?

If you're running on a remote server, you probably only want to use '%matplotlib inline' or '%matplotlib notebook'.

Sandbo Chang

unread,
Feb 8, 2016, 5:49:23 PM2/8/16
to Project Jupyter
My apology for forgetting to give this important piece of details, that explained it; I though Jupyter was able to make use of qt for displaying plot in separated window.

In that case I shall stick to inlne.

Reply all
Reply to author
Forward
0 new messages