Install graph tools on Ubuntu16.04

1 minute read


I used graph-tool when I was in a paper submission and encountered some problems during installation, so this page intended to be a reference to avoid some unnecessary ‘bugs’ during installation.

Official Document link:

During installation, you’d better use package managers to install instead of manual compilation. But there are still a few problems you may need to be careful. Here is the pipeline for graph tools installation:

Installation via package managers

  1. cd /etc/apt/, add the following codes after sources.list

     deb xenial universe  
     deb-src xenial universe

    xenial is the version of Ubuntu16.04 LTS, you may change it according to Ubuntu’s version (please get attention, it is very important!):

     14.04 trusty  
     14.10 utopic  
     15.04 vivid  
     15.10 wily  
     16.04 LTS xenial
  2. Update source.list

     sudo apt-get update

    Then, you will see a reminder of NO_PUBKEY like this:

    Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 7A80C8ED4FCCBE09

    You can try the following command (7A80C8ED4FCCBE09 may be different, it depends on your Ubuntu’s version)

     sudo apt-key adv --keyserver --recv-keys 7A80C8ED4FCCBE09
  3. Again, update your source.list

     sudo apt-get update
  4. Finally, install by apt-get

    If you are using Python2:

     sudo apt-get install python-graph-tool

    If you are using Python3:

     sudo apt-get install python3-graph-tool
  5. Test by Python

     from graph_tool.all import *

Leave a Comment