Ubuntu 框上的 igraph 安装失败

Failed igraph installation on a Ubuntu box

我尝试使用 easy_install 安装 igraph,并收到一条消息,要求联系包的作者或 easy_install 维护者。知道 igraph 在 SO 中有一个非常活跃的社区,我在下面粘贴消息:

sudo easy_install python-igraph
Searching for python-igraph
Reading https://pypi.python.org/simple/python-igraph/
Best match: python-igraph 0.7.1-2
Downloading https://pypi.python.org/packages/source/p/python-igraph/python-igraph-0.7.1-2.tar.gz#md5=4b1f4dc621fc938434836e59dea31173
Processing python-igraph-0.7.1-2.tar.gz
Writing /tmp/easy_install-R2pEQ_/python-igraph-0.7.1-2/setup.cfg
Running python-igraph-0.7.1-2/setup.py -q bdist_egg --dist-dir /tmp/easy_install-R2pEQ_/python-igraph-0.7.1-2/egg-dist-tmp-bl3Z_7
Cannot find the C core of igraph on this system using pkg-config.
We will now try to download and compile the C core from scratch.
Version number of the C core: 0.7.1-2
We will also try: 0.7.1

error: Setup script exited with error: SandboxViolation: mkdir('/usr/local/bin/tmp', 511) {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand.  Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.

我的机器已经有 C/C++。非常感谢任何帮助。

我在这里找到了一种解决方法:https://github.com/igraph/igraph/issues/680。直接安装C库试试; easy_install 在此之后工作。如果您遇到 igraph 的导入错误,请更新 LD_LIBRARY_PATH env 变量以包含 igraph 可执行文件的位置(通常为 /usr/local/bin)。