interactive_window not defined
Hi, I'm trying to plot a graph in an interactive window using the graph_draw command with no output, and I get an error that says "interactive_window is not defined". The same thing happens when I run from a notebook with the kwarg inline=False. I assume that this is an installation issue? I installed on a Mac via Homebrew, roughly following the recommended tutorial, and I'm pretty sure I have all the listed dependencies – boost, boost-python, cairo, cairomm, py2cairo, graphviz and many others are all installed via Homebrew. This problem is independent of MatPlotLib; in any case the backend is set to MacOSX in my matplotlibrc file. Please can you help me narrow it down? The error trace is below. Thanks! Charlie --------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-18-450166b22c69> in <module>() ----> 1 gt.graph_draw(g) #, inline=False) /usr/local/lib/python2.7/site-packages/graph_tool/draw/cairo_draw.pyc in graph_draw(g, pos, vprops, eprops, vorder, eorder, nodesfirst, output_size, fit_view, inline, output, fmt, **kwargs) 875 eprops[p] = _convert(edge_attrs.__dict__[p], val, 876 kwargs.get("ecmap", default_cm)) --> 877 return interactive_window(g, pos, vprops, eprops, vorder, eorder, 878 nodesfirst, **kwargs) 879 else: NameError: global name 'interactive_window' is not defined -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 17.11.2014 15:55, charlie wrote:
Hi,
I'm trying to plot a graph in an interactive window using the graph_draw command with no output, and I get an error that says "interactive_window is not defined". The same thing happens when I run from a notebook with the kwarg inline=False.
I assume that this is an installation issue? I installed on a Mac via Homebrew, roughly following the recommended tutorial, and I'm pretty sure I have all the listed dependencies – boost, boost-python, cairo, cairomm, py2cairo, graphviz and many others are all installed via Homebrew.
This problem is independent of MatPlotLib; in any case the backend is set to MacOSX in my matplotlibrc file.
Please can you help me narrow it down?
Do you have Gtk+ and gobject installed? Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Thank you very much for the reply Tiago. Apparently I did not have GTK installed. I have now installed gtk+3 via homebrew, and it has included several dependencies including gobject-introspection. Do I also need pygobject, or pygobject3? And will I need to reinstall graph-tool (using make or make configure)? Cheers, Charlie -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 18.11.2014 15:58, charlie wrote:
Thank you very much for the reply Tiago.
Apparently I did not have GTK installed. I have now installed gtk+3 via homebrew, and it has included several dependencies including gobject-introspection.
Do I also need pygobject, or pygobject3?
Yes, I think so.
And will I need to reinstall graph-tool (using make or make configure)?
No, this is not necessary. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Thanks. I have installed gtk+3 and pygobject , and have definite progress. Import graph_tool now launches an X11 session, so that's promising. But the command that should produce an interactive plot now gives a different error. Traceback below. Thank you very much for your ongoing help Tiago, you are a forum hero! Best, Charlie
gt.graph_draw(g, inline=False)
--------------------------------------------------------------------------- Error Traceback (most recent call last) <ipython-input-21-bd72d1c9116d> in <module>() ----> 1 gt.graph_draw(g, inline=False) /usr/local/lib/python2.7/site-packages/graph_tool/draw/cairo_draw.pyc in graph_draw(g, pos, vprops, eprops, vorder, eorder, nodesfirst, output_size, fit_view, inline, output, fmt, **kwargs) 876 kwargs.get("ecmap", default_cm)) 877 return interactive_window(g, pos, vprops, eprops, vorder, eorder, --> 878 nodesfirst, **kwargs) 879 else: 880 if isinstance(output, str): /usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in interactive_window(g, pos, vprops, eprops, vorder, eorder, nodesfirst, geometry, update_layout, async, **kwargs) 954 pos = sfdp_layout(g) 955 win = GraphWindow(g, pos, geometry, vprops, eprops, vorder, eorder, --> 956 nodesfirst, update_layout, **kwargs) 957 win.show_all() 958 if async: /usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in __init__(self, g, pos, geometry, vprops, eprops, vorder, eorder, nodesfirst, update_layout, **kwargs) 884 Gtk.Window.__init__(self, title="graph-tool's interactive window™") 885 icon = GdkPixbuf.Pixbuf.new_from_file('%s/graph-tool-logo.svg' % --> 886 os.path.dirname(__file__)) 887 self.set_icon(icon) 888 self.set_default_size(geometry[0], geometry[1]) Error: gdk-pixbuf-error-quark: Couldn't recognise the image file format for file '/usr/local/lib/python2.7/site-packages/graph_tool/draw/graph-tool-logo.svg' (3) -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
I’ve just installed libsvg and libsvg-cairo but neither one removes the error. Cheers, Charlie
On 18 Nov 2014, at 15:16, charlie <charliejharrison@gmail.com> wrote:
Thanks.
I have installed gtk+3 and pygobject , and have definite progress. Import graph_tool now launches an X11 session, so that's promising. But the command that should produce an interactive plot now gives a different error. Traceback below.
Thank you very much for your ongoing help Tiago, you are a forum hero!
Best,
Charlie
gt.graph_draw(g, inline=False)
--------------------------------------------------------------------------- Error Traceback (most recent call last) <ipython-input-21-bd72d1c9116d> in <module>() ----> 1 gt.graph_draw(g, inline=False)
/usr/local/lib/python2.7/site-packages/graph_tool/draw/cairo_draw.pyc in graph_draw(g, pos, vprops, eprops, vorder, eorder, nodesfirst, output_size, fit_view, inline, output, fmt, **kwargs) 876 kwargs.get("ecmap", default_cm)) 877 return interactive_window(g, pos, vprops, eprops, vorder, eorder, --> 878 nodesfirst, **kwargs) 879 else: 880 if isinstance(output, str):
/usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in interactive_window(g, pos, vprops, eprops, vorder, eorder, nodesfirst, geometry, update_layout, async, **kwargs) 954 pos = sfdp_layout(g) 955 win = GraphWindow(g, pos, geometry, vprops, eprops, vorder, eorder, --> 956 nodesfirst, update_layout, **kwargs) 957 win.show_all() 958 if async:
/usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in __init__(self, g, pos, geometry, vprops, eprops, vorder, eorder, nodesfirst, update_layout, **kwargs) 884 Gtk.Window.__init__(self, title="graph-tool's interactive window™") 885 icon = GdkPixbuf.Pixbuf.new_from_file('%s/graph-tool-logo.svg' % --> 886 os.path.dirname(__file__)) 887 self.set_icon(icon) 888 self.set_default_size(geometry[0], geometry[1])
Error: gdk-pixbuf-error-quark: Couldn't recognise the image file format for file '/usr/local/lib/python2.7/site-packages/graph_tool/draw/graph-tool-logo.svg' (3)
-- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com. _______________________________________________ graph-tool mailing list graph-tool@skewed.de http://lists.skewed.de/mailman/listinfo/graph-tool
I have that too but am still getting the same error :(
On 18 Nov 2014, at 15:39, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
On 18.11.2014 16:35, Charlie Harrison wrote:
I’ve just installed libsvg and libsvg-cairo but neither one removes the error.
You need to install librsvg (not libsvg).
Best, Tiago
-- Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________ graph-tool mailing list graph-tool@skewed.de http://lists.skewed.de/mailman/listinfo/graph-tool
On 18.11.2014 16:46, Charlie Harrison wrote:
I have that too but am still getting the same error :(
Well, strange. This is probably a homebrew bug. Looking at https://github.com/Homebrew/homebrew/blob/master/Library/Formula/librsvg.rb it looks like the version there is pretty old, and for some reason introspection is not enabled. I should report this problem to them. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Ok, I’ll do that. Thanks again for your efforts. Cheers, Charlie
On 18 Nov 2014, at 15:54, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
On 18.11.2014 16:46, Charlie Harrison wrote:
I have that too but am still getting the same error :(
Well, strange. This is probably a homebrew bug. Looking at
https://github.com/Homebrew/homebrew/blob/master/Library/Formula/librsvg.rb
it looks like the version there is pretty old, and for some reason introspection is not enabled.
I should report this problem to them.
Best, Tiago
-- Tiago de Paula Peixoto <tiago@skewed.de>
_______________________________________________ graph-tool mailing list graph-tool@skewed.de http://lists.skewed.de/mailman/listinfo/graph-tool
Hi again Tiago! I tried editing the Homebrew formula for librsvg to obtain the latest version and enable introspection, and sure enough I can now produce an interactive graph! Hooray! I've posted the issue on the Homebrew github page that you referred. BUT: now I have a different problem. In my beautiful interactive graphs, the second node I select infallibly triggers a fatal error that kills the kernel. Here it is: /usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.py:493: Warning: g_object_ref: assertion 'G_IS_OBJECT (object)' failed icon = self.render_icon(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in draw(self, da, cr) 492 if self.surface_callback is not None: 493 icon = self.render_icon(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON) --> 494 Gdk.cairo_set_source_pixbuf(cr, icon, 10, 10) 495 cr.paint() 496 TypeError: Argument 1 does not allow None as a value --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in draw(self, da, cr) 492 if self.surface_callback is not None: 493 icon = self.render_icon(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON) --> 494 Gdk.cairo_set_source_pixbuf(cr, icon, 10, 10) 495 cr.paint() 496 TypeError: Argument 1 does not allow None as a value Any ideas? Thanks! -- View this message in context: http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/... Sent from the Main discussion list for the graph-tool project mailing list archive at Nabble.com.
On 18.11.2014 19:12, charlie wrote:
Hi again Tiago!
I tried editing the Homebrew formula for librsvg to obtain the latest version and enable introspection, and sure enough I can now produce an interactive graph! Hooray! I've posted the issue on the Homebrew github page that you referred.
BUT: now I have a different problem. In my beautiful interactive graphs, the second node I select infallibly triggers a fatal error that kills the kernel. Here it is:
/usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.py:493: Warning: g_object_ref: assertion 'G_IS_OBJECT (object)' failed icon = self.render_icon(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in draw(self, da, cr) 492 if self.surface_callback is not None: 493 icon = self.render_icon(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON) --> 494 Gdk.cairo_set_source_pixbuf(cr, icon, 10, 10) 495 cr.paint() 496
TypeError: Argument 1 does not allow None as a value
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) /usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in draw(self, da, cr) 492 if self.surface_callback is not None: 493 icon = self.render_icon(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON) --> 494 Gdk.cairo_set_source_pixbuf(cr, icon, 10, 10) 495 cr.paint() 496
TypeError: Argument 1 does not allow None as a value
Any ideas? Thanks!
Well, this is obviously a Gtk bug, since it is failing to render a stock icon. You should also report this to the homebrew people. (Alternatively, you may try Macports, where it is reported to work) Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Thanks Tiago. Using the Macports install was the very first thing I tried, I’m rather committed to Homebrew through other packages. The two of them don’t play nicely together, and I ended up breaking a lot of other things. I might look into trying to get them to cooperate if I can’t get a fix for GTK. Cheers, Charlie
On 18 Nov 2014, at 18:42, Tiago de Paula Peixoto <tiago@skewed.de> wrote:
On 18.11.2014 19:12, charlie wrote:
Hi again Tiago!
I tried editing the Homebrew formula for librsvg to obtain the latest version and enable introspection, and sure enough I can now produce an interactive graph! Hooray! I've posted the issue on the Homebrew github page that you referred.
BUT: now I have a different problem. In my beautiful interactive graphs, the second node I select infallibly triggers a fatal error that kills the kernel. Here it is:
/usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.py:493: Warning: g_object_ref: assertion 'G_IS_OBJECT (object)' failed icon = self.render_icon(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) /usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in draw(self, da, cr) 492 if self.surface_callback is not None: 493 icon = self.render_icon(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON) --> 494 Gdk.cairo_set_source_pixbuf(cr, icon, 10, 10) 495 cr.paint() 496
TypeError: Argument 1 does not allow None as a value
--------------------------------------------------------------------------- TypeError Traceback (most recent call last) /usr/local/lib/python2.7/site-packages/graph_tool/draw/gtk_draw.pyc in draw(self, da, cr) 492 if self.surface_callback is not None: 493 icon = self.render_icon(Gtk.STOCK_EXECUTE, Gtk.IconSize.BUTTON) --> 494 Gdk.cairo_set_source_pixbuf(cr, icon, 10, 10) 495 cr.paint() 496
TypeError: Argument 1 does not allow None as a value
Any ideas? Thanks!
Well, this is obviously a Gtk bug, since it is failing to render a stock icon. You should also report this to the homebrew people.
(Alternatively, you may try Macports, where it is reported to work)
Best, Tiago
-- Tiago de Paula Peixoto <tiago@skewed.de <mailto:tiago@skewed.de>>
_______________________________________________ graph-tool mailing list graph-tool@skewed.de <mailto:graph-tool@skewed.de> http://lists.skewed.de/mailman/listinfo/graph-tool <http://lists.skewed.de/mailman/listinfo/graph-tool>
participants (3)
-
charlie -
Charlie Harrison -
Tiago de Paula Peixoto