0

I just started a jupyterhub server so that I can save all my data on one machine and have collaborators connect to access the data. Part of the code uses a GTK window which I normally launch from an ipython notebook. The error I get is TypeError: constructor returned NULL (full traceback). I can pretty easily reproduce this by making a new notebook and running from matplotlib import pyplot since by default it uses the GTK backend of my system.

So this works if I run it from the conventional jupyter-notebook and not through jupyterhub even if the notebook is accessed from the same computer that the server is running on. I recognize that many clients won't be able to load the GTK components if they don't have it installed themselves so I structured the software so that Gtk/Gdk only get imported when necessary. If I can't use it at all, though, then I will have to abandon the jupyterhub idea and think of something else.

Thomas K
  • 39,200
  • 7
  • 84
  • 86
m3wolf
  • 114
  • 4
  • You will need to switch to using the `%maplotlib nbagg` backend. – tacaswell Jan 22 '16 at 03:22
  • also keep an eye on the coming phosphor work. – tacaswell Jan 22 '16 at 03:22
  • nbagg looks interesting but I don't really need the gtk panning window. I have a FigureCanvasGTK3Agg as part of a gtk window with other controls that aren't in the regular matplotlib viewing window. – m3wolf Jan 22 '16 at 15:14
  • For anyone coming to this in the future, I am planning on re-writing the GUI using ipython widgets: https://github.com/ipython/ipywidgets – m3wolf Jan 26 '16 at 02:50
  • You should also keep an eye on https://github.com/matplotlib/matplotlib/pull/5754 which should make this sort of thing easier. – tacaswell Jan 26 '16 at 03:04

0 Answers0