我正在尝试使用 python iGraph 进行网络可视化。当我尝试绘制图表时,我收到了他的错误消息:
>>> layout = g.layout("kk")
>>> plot(g, layout = layout)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "build/bdist.macosx-10.5-x86_64/egg/igraph/drawing/__init__.py", line 446, in plot
File "build/bdist.macosx-10.5-x86_64/egg/igraph/drawing/__init__.py", line 117, in __init__
File "build/bdist.macosx-10.5-x86_64/egg/igraph/drawing/utils.py", line 396, in __getattr__
TypeError: plotting not available
我认为我没有正确安装 Cairo 或 PyCairo。
我不熟悉使用 Fink 或 MacPorts,因为我通常使用 Homebrew。
任何帮助您将不胜感激。
您需要手动编译该库。我使用了解决方案here https://github.com/Automattic/node-canvas/wiki/Installation---OSX并且刚刚更新了版本。
curl -L https://www.cairographics.org/releases/cairo-1.14.6.tar.xz -o cairo.tar.xz
tar -xf cairo.tar.xz && cd cairo-1.14.6
./configure --prefix=/usr/local --disable-dependency-tracking
make install
如果在运行configure时,您收到有关pkg_config的错误,您可以使用brew安装它:
brew install pkg-config
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)