error importing igraph

跟風遠走 提交于 2019-12-02 11:48:42

The glpk dependency is missing, because when installing igraph, only the default packages are searched for. glpk lives, just like igraph, in an extra homebrew repository called homebrew/science. You can automatically access that repository by "tapping" it:

brew tap homebrew/science

Now, all packages included in this repository are also searched for. To confirm, try and see if the following two commands give just the package name back:

brew search glpk

brew search igraph

Before reinstalling igraph, you have to fix the link issue with gmp; this is just a result of homebrew not completely uninstalling igraph and its dependencies during the uninstall step. For this, you can follow homebrew's suggestion:

brew link --overwrite gmp

(You're overwriting the gmp package with the previously and still partly installed gmp package; they are the same, so no harm is done.)


Now, you should be able to install igraph:

brew install igraph

If this also gives a warning/error about links, use the same --overwrite option as for gmp.

In case brew install igraph did not install glpk (i.e., you didn't see a message like "==> Installing igraph dependency: glpk"), you can simply install it separately:

brew install glpk

Give or take a minor detail, you should now have a working igraph installation (and, since you never uninstalled python-igraph, this should also still work).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!