无法在 python 3.7 上安装 igraph

Unable to install igraph on python 3.7

我需要通过 pip3 将 python-igraph 安装到 python 3.7 中。 当我 运行: pip3 install python-igraph 时,我收到此消息错误:

Command "/usr/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-whiv93xm/python-igraph/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /tmp/pip-kbqa7cno-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-whiv93xm/python-igraph/

有关信息,我在 python 2.7.

上有它

谢谢。

您可能需要在安装库之前安装一些依赖项。 试试这个:

sudo apt install libxml2-dev libz-dev python-dev python3-dev build-essential

然后继续:

sudo pip3 install python-igraph

我希望这有效