Skip to content

Instantly share code, notes, and snippets.

@nlap
Last active January 3, 2022 21:07
Show Gist options
  • Save nlap/56061e47a2a8d69eb5f3 to your computer and use it in GitHub Desktop.
Save nlap/56061e47a2a8d69eb5f3 to your computer and use it in GitHub Desktop.
graph-tool on Ubuntu 14.04

graph-tool on Ubuntu 14.04

Recommended: Graph-tool one-line install commands:

anaconda conda create --name gt -c conda-forge graph-tool

homebrew brew install graph-tool

debian/ubuntu apt-get install python3-graph-tool

The following information is no longer maintained:

Here are the steps to install graph-tool on Ubuntu 14.04, including all the prerequisites:

sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y install expat
sudo apt-get -y install libsparsehash-dev
sudo apt-get -y install gtk+3
sudo apt-get -y install libboost-all-dev
sudo apt-get -y install graphviz
sudo apt-get -y install build-essential
sudo apt-get -y install libcairo2-dev
sudo apt-get -y install python-pip
sudo apt-get -y install python-dev
sudo apt-get -y install python-matplotlib
sudo apt-get -y install gfortran libopenblas-dev liblapack-dev
sudo apt-get -y install libcgal-dev
sudo apt-get -y install python-numpy
sudo apt-get -y install python2.7-config
sudo apt-get -y install python-cairo
sudo apt-get -y install python-scipy
sudo apt-key adv --keyserver pgp.skewed.de --recv-key 98507F25
echo 'deb http://downloads.skewed.de/apt/trusty trusty universe' | sudo tee -a  /etc/apt/sources.list
echo 'deb-src http://downloads.skewed.de/apt/trusty trusty universe' | sudo tee -a  /etc/apt/sources.list
sudo apt-get update
sudo apt-get -y --force-yes install python-graph-tool
@sjvrijn
Copy link

sjvrijn commented Nov 1, 2015

After 6+ hours of trying to get it to work on windows, this worked first time.
Thanks!

@ArangoGutierrez
Copy link

I didn't work on 14.04, how can i get it done. pls help

@nlap
Copy link
Author

nlap commented Nov 29, 2015

What error are you getting?

@Neal-liu
Copy link

Neal-liu commented Dec 3, 2015

It works. Thanks !!

@Neal-liu
Copy link

Neal-liu commented Dec 4, 2015

I tried it to another PC, and I find out the error :

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:
python-graph-tool : Depends: libgomp1 (>= 4.9) but 4.8.4-2ubuntu114.04 is to be installed
Depends: libstdc++6 (>= 5) but 4.8.4-2ubuntu1
14.04 is to be installed
E: Unable to correct problems, you have held broken packages.

How to solve it !?

@eunachen
Copy link

I have the same problem

The following packages have unmet dependencies:
python-graph-tool : Depends: libgomp1 (>= 4.9) but 4.8.4-2ubuntu114.04 is to be installed
Depends: libstdc++6 (>= 5) but 4.8.4-2ubuntu1
14.04 is to be installed
E: Unable to correct problems, you have held broken packages.

@nlap
Copy link
Author

nlap commented Dec 20, 2015

Confirmed on 14.04.3. The latest version of graph-tool needs GCC 4.9.

I updated the gist and it should work again now.

@kevinbsc
Copy link

Are there any changes in the steps above if I want to use Anaconda distribution?

@nlap
Copy link
Author

nlap commented Jan 29, 2016

If the packages are all available then it should be about the same. I found a lot had to be compiled from source to run on Fedora.

You'll want to read the official install docs: http://graph-tool.skewed.de/download

@vishnun
Copy link

vishnun commented Nov 12, 2016

Update: Actually saw this error as well before the follwing..
E: Failed to fetch http://ppa.launchpad.net/boost-latest/ppa/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found

Tried installing on latest ubuntu version (16). Above steps ran successfully but last step to finally install the graph tool failed. Seems like a specific version of libraries do not exist?
Can someone help with solving this..
Below is the command line output with the failure..

**✗ sudo apt-get -y --force-yes install python-graph-tool**
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:
 python-graph-tool : Depends: libboost-iostreams1.55.0 but it is not installable
                     Depends: libboost-python1.55.0 but it is not installable
                     Depends: libboost-regex1.55.0 but it is not installable
                     Depends: libcairomm-1.0-1 (>= 1.6.4) but it is not installable
                     Depends: libboost-graph1.55.0 but it is not installable
                     Depends: libboost-system1.55.0 but it is not installable
                     Depends: libboost-thread1.55.0 but it is not installable
                     Depends: libcgal10 but it is not installable
E: Unable to correct problems, you have held broken packages.

Tried installing one of them separately and got this...

**✗ sudo apt-get -y install libboost-system1.55.0**                                                            
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package libboost-system1.55.0 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'libboost-system1.55.0' has no installation candidate

@nlap
Copy link
Author

nlap commented Jan 4, 2017

I haven't tested these instructions on 16.04, but try the following:

  • I think the first step (adding the toolchain PPA) isn't necessary anymore
  • Change all trusty to xenial

Ps.: to get this running on Python 3, change all python to python3

@LeMikaelF
Copy link

After a few hours of fiddling, I found this and it worked perfectly on 14.04.

@dacamargov
Copy link

I have the same problem in 16.04.

root@daniel-Lenovo-Yoga-500-14IBD:/home/Documents# sudo apt-get -y --force-yes install python-graph-tool
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:
python-graph-tool : Depends: libboost-coroutine1.61.0 but it is not installable
Depends: libboost-iostreams1.61.0 but it is not installable
Depends: libboost-python1.61.0 but it is not installable
Depends: libboost-regex1.61.0 but it is not installable
Depends: libboost-graph1.61.0 but it is not installable
Depends: libboost-system1.61.0 but it is not installable
Depends: libboost-thread1.61.0 but it is not installable
E: Unable to correct problems, you have held broken packages.

any idea? Thanks in advance.

@nlap
Copy link
Author

nlap commented Jun 7, 2017

There might be a solution to the 16.04 Boost problem here: https://stackoverflow.com/questions/21510633/my-apt-got-messed-up-installing-boost


FYI: I'm not going to maintain this unofficial Gist anymore, although I hope it might still be helpful

The official install docs are here: https://git.skewed.de/count0/graph-tool/wikis/installation-instructions

@salvador-blanco
Copy link

@Neal-liu @eunachen Where you able to solve the Depends problem ?

depends

@feeds
Copy link

feeds commented May 22, 2018

I wanted to use graph_tool with python3 on travis.
In case anyone with the same problem arrived here as well, this travis-file works: https://gist.github.com/feeds/639f7dc7f86c3bd717714427e1dc64c3
Let me know if there is an easier way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment