Are you certain that you are using system python? What does `which python3` 
return? Do other python packages installed via apt function as expected? 

Sent from my phone 

> On 28 Apr 2020, at 19:40, Narges <[email protected]> wrote:
> 
> 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: 
> https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fmain-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com%2F&amp;data=02%7C01%7CRedfernJM%40cardiff.ac.uk%7C1655bf5f314c488a5a2e08d7eba3a9b6%7Cbdb74b3095684856bdbf06759778fcbc%7C1%7C0%7C637236960470199932&amp;sdata=COyHrIjdNwXTqHzHb5yBwSHie9BEwGBDDR8EHwHgF0o%3D&amp;reserved=0
> _______________________________________________
> graph-tool mailing list
> [email protected]
> https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.skewed.de%2Fmailman%2Flistinfo%2Fgraph-tool&amp;data=02%7C01%7CRedfernJM%40cardiff.ac.uk%7C1655bf5f314c488a5a2e08d7eba3a9b6%7Cbdb74b3095684856bdbf06759778fcbc%7C1%7C0%7C637236960470209931&amp;sdata=iSsAXIMjygXunip8t9A4vO3JdCBr3YBshJ2la7G6%2BLk%3D&amp;reserved=0
_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to