2

I installed Graph-tool via homebrew

$ brew --prefix graph-tool
/usr/local/opt/graph-tool

But I still get error when trying to import it.

I have read related posts How to let python3 import graph-tool installed by Homebrew? and tried all the solutions provided there, but none of them fixed it. Adding the path in python doesn't work, re-run homebrew as below doesn't either.

$ brew install graph-tool --with-python2.7
Warning: homebrew/science/graph-tool 2.26_1 is already installed

I usually use python via anaconda, but I also tried importing it from python console and it didn't work.

Nelly Kong
  • 279
  • 1
  • 2
  • 18
  • What kind of import error occurred? I looked at the link to the other SO question and the answer by Kevin, although hacky, should explicitly add a link to enable import of graph-tool. – kuanb Jan 11 '18 at 23:47

1 Answers1

0

In my case, I was in a virtualenv. Recreating the virtualenv with --system-site-packages allows it to access system packages, including graph-tool installed through homebrew.

Source: https://github.com/Homebrew/homebrew-science/issues/5741

Wei
  • 1,252
  • 13
  • 19