Installing graph-tool for Python 3 on Anaconda

Anaconda is a great Python environment, no doubt about that. However, it was not immediately easy to make graph-tool run smoothly on it. That took some time and a little google-fu to make things work.

Edit: as suggested by Morten Grøftehauge, I published this conda environment at https://anaconda.org/ruliana/graph-tool

The dependency with GTK is one of the problems and here I explain what I did to fix them.

First, open “anaconda-navigator” and add three new channels:

  • conda-forge
  • ostrokach-forge
  • pkgw-forge
Image for post
Image for post
New channel in anaconda-navigator

Then, install the following packages:

  • gtk3 (from pkgw-forge)
  • pygobject (from conda-forge)
  • matplotlib (from conda-forge)
  • graph-tool (from ostrokach-forge)
Image for post
Image for post
Install graph-tool and dependencies

Done!

Open a Python console in this environment and type:

> from graph_tool.all import *

If the import goes fine, graph-tool is properly installed. Go ahead and be happy :)

Written by

Just a common guy

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store