Hi, this is the first time I'm dabbling into graph-tool as I had always
been using networkx. Anyway, I managed to successfully install the package
When I run: import graph_tool -- everything seems to be running okay.
However, when I run: from graph_tool.all import *
I am getting the following:
ERROR:root:Could not find any typelib for Gtk
ERROR:root:Could not find any typelib for Gdk
ERROR:root:Could not find any typelib for GdkPixbuf
Has anyone encountered this before? Were you able to resolve it?
attachment.html (1.42 KB)
These are just warnings, right? The module actually imports
This is probably just because you don't have GTK+ 3 installed, which is
needed for interactive visualization. Just do:
port install gtk3
and everything should work.
I have the same issue. Have not resolved it yet.
attachment.html (2.11 KB)
After updating graph-tool ( to version |2.2.31 (commit 245d1e2c, Thu Mar
27 11:28:39 2014 +0100)|), and a bunch of over things as I passed to
Mint 15 to Mint 16, I encounter the following value error, when I
manipulates parts of a PropertyMap (through indexing or via the |.fa|
attribute (bellow, |dthetas| is an edge propertymap on a graph):
lower_than = [dthetas.a < -tau/2.]
dthetas.a[lower_than] += tau
ValueError: output arrayis read-only|
Note that the following doesn't rise the error:
lower_than = [dthetas.a < -tau/2.]
dthetas.a[lower_than] = dthetas.a[lower_than] + tau|
It also happen when I filter a graph and do for example |eprop.fa *= 2|
I just wanted to know if this is expected, and I‘ll go fix my code
everywhere I do that kind of assignation, or if it is unintended (and
I’ll go fix my code anyway ;-).
attachment.html (7.87 KB)
I don't observe this. What numpy version are you using?
Do you see the same behavior if you use
lower_than = dthetas.a < -tau/2.
i.e. without the square brackets?
Do you see the same behavior if you use |lower_than = dthetas.a <
Yes I do.
lower_than = eptm.dthetas.a < -np.pi
eptm.dthetas.a[lower_than] +=2 * np.pi
This also rises an error:
But not this:
colors.a -=5 # Whole array
What numpy version are you using?
np.*version* >> ‘1.9.0.dev-61c699e’
attachment.html (10 KB)
I'm using 1.8.1 here. So, it seems they changed the semantics of indexed
Can you observe the same with plain numpy arrays?, i.e:
a = arange(10)
m = a > 5
a[m] += 2
a[:][m] += 2
This doesn't rise the ValueError
Ok, it looks like something nontrivial changed in the internals of numpy
1.9. I'll have to investigate... But I'll wait until version 1.9 is
actually released, to be sure it is not some bug.
OK, no problem, a good occasion to revise my code...
attachment.html (1.51 KB)
Thanks, Tiago. I do have gtk3 installed. What I did was install XQuartz
instead, and it helped fix this particular issue-- allowing me to run that
line (from graph_tool.all import *) without error.
However, this error appeared
gi._glib.GError: Couldn't recognize the image file format for file
Exception AttributeError: "'GraphWindow' object has no attribute 'graph'"
in <bound method GraphWindow.__del__ of <GraphWindow object at 0x13348b690
(graph_tool+draw+gtk_draw+GraphWindow at 0x7fb15c82a320)>> ignored
when I ran this:
from graph_tool.all import *
g1 = Graph()
v1 = g1.add_vertex()
v2 = g1.add_vertex()
e = g1.add_edge(v1,v2)
graph_draw(g1, *vertex_text* = g1.vertex_index, *vertex_font_size* = 18)
I couldn't find any other solutions online.
attachment.html (3.21 KB)
For some reason the macports port for Gtk does not include the default
SVG libraries. You have to install it:
port install librsvg
*These are just warnings, right? The module actually imports successfully?
Tiago, the former issue didn't allow me to successfully import * from
But I've fixed it after I installed XQuartz 2.7.5. Thanks.
attachment.html (593 Bytes)
Thanks, Tiago! That (port install librsvg) fixed it. Whew. No more errors
at the moment. Cheers!
attachment.html (1.91 KB)
Overall, which ports did you need to install to get the full
functionality? This is would be good information to put on the webpage.