Error in installing graph-tool in Ubuntu 18.04

I followed the installation instructions in the website:

   https://git.skewed.de/count0/graph-tool/-/wikis/installation-instructions

for installing graph-tool on Ubuntu 18.04, but when I write "sudo apt-get
install python3-graph-tool" in the terminal, it gives me the following
error:

Reading package lists... Done

Building dependency tree
      
Reading state information... Done

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

The following information may help to resolve the situation:

The following packages have unmet dependencies:

python3-graph-tool : Depends: libboost-context1.67.0 but it is not
installable

                      Depends: libboost-iostreams1.67.0 but it is not
installable

                      Depends: libboost-python1.67.0 but it is not
installable

                      Depends: libboost-python1.67.0-py38 but it is not
installable

                      Depends: libboost-regex1.67.0-icu63 but it is not
installable

                      Depends: libc6 (>= 2.29) but 2.27-3ubuntu1 is to be
installed
                      Depends: libgcc-s1 (>= 3.4) but it is not installable

                      Depends: libgomp1 (>= 9) but 8.4.0-1ubuntu1~18.04 is
to be installed

                      Depends: libstdc++6 (>= 9) but 8.4.0-1ubuntu1~18.04 is
to be installed

E: Unable to correct problems, you have held broken packages.

Does anyone know how I can fix it?

I can't reproduce this. Following the instructions on Ubuntu 18.04
(bionic beaver) works fine.

Can you please let us know exactly which line did you add to
sources.list? Did you run 'apt-get update' afterwards?

Best,
Tiago

I added these lines to /etc/apt/sources.list:

deb [ arch=amd64 ] https://downloads.skewed.de/apt bullseye main
deb [ arch=amd64 ] https://downloads.skewed.de/apt buster main
deb [ arch=amd64 ] https://downloads.skewed.de/apt sid main
deb https://downloads.skewed.de/apt/raring raring universe
deb-src https://downloads.skewed.de/apt/raring raring universe
deb [ arch=amd64 ] https://downloads.skewed.de/apt bionic main
deb [ arch=amd64 ] https://downloads.skewed.de/apt bionic beaver main

And after that I wrote "sudo apt-get update" and then "sudo apt-get install
python3-graph-tool". But the problem still is not solved.

Why did you add all these lines? You only need the one for your
distribution:

   deb [ arch=amd64 ] https://downloads.skewed.de/apt bionic main

Thank you so much. I removed the other lines and now it works. I really
appreciate you.

Although I installed graph-tool, when I write "from graph_tool.all import *",
it shows an error that "No module named graph_tool".

Double check you are using the correct Python 3 interpreter, i.e. not
Python 2, or an installation different from the system's (e.g. Anaconda).

I am using python3. I also have python2, but I tried python3. I am not using
Anaconda.

Well, I don't have mind reading abilities, nor do I have access to an
oracle. All I can say is that invoking the standard Python 3 interpreter
in Ubuntu 18.04 works perfectly fine for me, so this must be something
at your end.

In general, just saying "it does not work" is next to useless, as it
gives very little information for those that might want to help. You
have to try to give more information, explaining *exactly* what you are
doing, etc.

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'

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

Oh, you are right. when I write "which python3", it says
"/home/narges/miniconda3/bin/python3". So, it is using miniconda3. How can I
use system python?

Anaconda works by injecting itself into your PATH environmental variable. Running `conda deactivate` should remove it.

As an alternative, you could install the graph-tool anaconda package via `conda install -c conda-forge graph-tool`.

Thank you so much. I tried both of your suggestions, but now when I run the
program, it shows the following error:

/home/narges/miniconda3/lib/python3.7/site-packages/graph_tool/draw/cairo_draw.py:1494:
RuntimeWarning: Error importing Gtk module: No module named 'gi'; GTK+
drawing will not work.
  warnings.warn(msg, RuntimeWarning)
Traceback (most recent call last):
  File "GirvanIgraph.py", line 18, in <module>
    igraph_graph = pyintergraph.gt2igraph(graph_tool_graph,
labelname="node_label")
  File
"/home/narges/miniconda3/lib/python3.7/site-packages/pyintergraph/funcs.py",
line 17, in gt2igraph
    return G.to_igraph()
  File
"/home/narges/miniconda3/lib/python3.7/site-packages/pyintergraph/Graph.py",
line 289, in to_igraph
    iG.vs[i].update_attributes(name=self.node_labels[node], **attr)
TypeError: update_attributes() got multiple values for keyword argument
'name'

Thank you so much. It is solved. My mistake was that I wrote 'conda
deactivate' in the home directory instead of the code's directory. But now
it shows another error. When I run my code, it shows this error:

Traceback (most recent call last):
  File "GirvanIgraph.py", line 18, in <module>
    igraph_graph = pyintergraph.gt2igraph(graph_tool_graph,
labelname="node_label")
  File
"/home/narges/.local/lib/python3.6/site-packages/pyintergraph/funcs.py",
line 17, in gt2igraph
    return G.to_igraph()
  File
"/home/narges/.local/lib/python3.6/site-packages/pyintergraph/Graph.py",
line 289, in to_igraph
    iG.vs[i].update_attributes(name=self.node_labels[node], **attr)
TypeError: update_attributes() got multiple values for keyword argument
'name'

Whenever reporting problems, just pasting the error message without any
context is not very useful, since it becomes pure guesswork. Instead,
you should provide a *minimal* and *self-contained* program that
reproduces the problem you are encountering. Otherwise we cannot help.

(Just guessing from the traceback, this seems to be triggered by the
"pyintergraph' package rather than graph-tool, in which case this would
be the wrong mailing list to ask.)

Best,
Tiago

Thank you so much. The problem was in 'pyintergraph' package. I contacted
them and it is solved.