mayavi with graph-tool
Hello all, I am pretty new to graph-tool and trying it because of the fast speed. However, it seems that graph-tool cannot work together with mlab in mayavi. I am basically planning to plot a 3D graph using mlab. But when I import mlab from mayavi, the program always prints the following warning and then becomes frozen. I don't know why. Is it the problem of gtk? I just want to use graph-tool data structure and algorithms output : /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: cannot register existing type `GtkWidget' g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: cannot add class private field to invalid type '<invalid>' g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: cannot register existing type `GtkBuildable' g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: g_once_init_leave: assertion `result != 0' failed g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:146: Warning: g_type_get_qdata: assertion `node != NULL' failed type_ = g_type.pytype -- Cheers, Bo Wu
This warning indicates you are mixing gtk2 and gtk3. Just so you know, the import for gtk3 looks like: from gi.repository import Gtk The equivalent for gtk2 looks like this: import gtk I hope that can steer you in the right direction, cheers! -- Johann <https://sites.google.com/site/theodoregoetz/> On Sun, Apr 19, 2015 at 11:49 AM, Bo Wu <wubogfkd@gmail.com> wrote:
Hello all,
I am pretty new to graph-tool and trying it because of the fast speed. However, it seems that graph-tool cannot work together with mlab in mayavi.
I am basically planning to plot a 3D graph using mlab. But when I import mlab from mayavi, the program always prints the following warning and then becomes frozen. I don't know why. Is it the problem of gtk? I just want to use graph-tool data structure and algorithms
output :
/usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: cannot register existing type `GtkWidget' g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: cannot add class private field to invalid type '<invalid>' g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: g_type_add_interface_static: assertion `G_TYPE_IS_INSTANTIATABLE (instance_type)' failed g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: cannot register existing type `GtkBuildable' g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: g_type_interface_add_prerequisite: assertion `G_TYPE_IS_INTERFACE (interface_type)' failed g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:142: Warning: g_once_init_leave: assertion `result != 0' failed g_type = info.get_g_type() /usr/lib/python2.7/dist-packages/gi/module.py:146: Warning: g_type_get_qdata: assertion `node != NULL' failed type_ = g_type.pytype
-- Cheers, Bo Wu
_______________________________________________ graph-tool mailing list graph-tool@skewed.de http://lists.skewed.de/mailman/listinfo/graph-tool
On 19.04.2015 20:39, Johann Goetz wrote:
This warning indicates you are mixing gtk2 and gtk3.
This is correct. You cannot mix gtk2 and gtk3 in the same program. If you don't need to use the drawing routines of graph-tool, you can avoid importing gtk3 by not importing anything from the graph_tool.draw module. Simply avoid doing "from graph_tool.all import *" and import only the submodules you need. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
Thanks you! That solved the problem. BTW, I never use "from graph_tool.all import *", instead I use "import graph_tool.all as gt", which also caused the above problem. Can the draw module in graph_tool plot 3d graph and simply interactively view it ? I can only find 2d examples in the doc. That's why I turned to mayavi 2015-04-20 1:56 GMT+08:00 Tiago de Paula Peixoto <tiago@skewed.de>:
On 19.04.2015 20:39, Johann Goetz wrote:
This warning indicates you are mixing gtk2 and gtk3.
This is correct. You cannot mix gtk2 and gtk3 in the same program.
If you don't need to use the drawing routines of graph-tool, you can avoid importing gtk3 by not importing anything from the graph_tool.draw module.
Simply avoid doing "from graph_tool.all import *" and import only the submodules you need.
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
-- Cheers, Bo Wu
On 20.04.2015 04:34, Bo Wu wrote:
Can the draw module in graph_tool plot 3d graph and simply interactively view it ? I can only find 2d examples in the doc. That's why I turned to mayavi
There is not 3D drawing at the moment. Best, Tiago -- Tiago de Paula Peixoto <tiago@skewed.de>
participants (3)
-
Bo Wu -
Johann Goetz -
Tiago de Paula Peixoto