OK, when I write "sudo apt-get install python3-graph-tool", it says
"python3-graph-tool is already the newest version (2.31-2).". Then, when I
want to run the code shown below:
#Start of the code:
*# Girvan - Newman
# igraph
import networkx as nx
from igraph import *
import tempfile
import igraph as ig
import pyintergraph
from graph_tool.all import *
#g = read_graph("Network.graphml", format = c("graphml"))
g = nx.read_graphml("Network.graphml")
# nx_graph = nx.karate_club_graph()
graph_tool_graph = pyintergraph.nx2gt(g, labelname="node_label")
igraph_graph = pyintergraph.gt2igraph(graph_tool_graph,
labelname="node_label")
# reversed_nx_graph = pyintergraph.igraph2nx(igraph_graph)
# fobj = tempfile.NamedTemporaryFile()
g2 = nx.path_graph(4)
nx.write_gml(g2, 'test.gml')
# g = Graph.Read_GML("test.gml")
d = igraph_graph.community_edge_betweenness()
p = d.as_clustering()
Q = igraph_graph.modularity(p)
print(d)
print(p)
print(Q)
# End of the code
I write " python3 GirvanIgraph.py" in a terminal and GirvanIgraph.py is the
name of the file, it shows the following error:
Traceback (most recent call last):
File "GirvanIgraph.py", line 9, in <module>
from graph_tool.all import *
ModuleNotFoundError: No module named 'graph_tool'
--
Sent from:
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool