为python安装'igraph'时如何解决“找不到-lxml2”错误?

Ale*_*lex 7 xml python software-installation

在 Ubuntu 15.04 上,我尝试使用以下命令安装“igraph”:

pip install python-igraph
Run Code Online (Sandbox Code Playgroud)

为了,好吧,使用igraphpython 中的包来处理图形和东西。但是,安装失败并显示以下输出

/usr/bin/ld: cannot find -lxml2
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
Makefile:2357: recipe for target 'libigraph.la' failed
make[3]: *** [libigraph.la] Error 1
make[3]: Leaving directory '/tmp/pip-build-8dtEwd/python-igraph/tmp/igraph.dZXTk4/igraph-0.7.1/src'
Makefile:1377: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/tmp/pip-build-8dtEwd/python-igraph/tmp/igraph.dZXTk4/igraph-0.7.1/src'
Makefile:480: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/pip-build-8dtEwd/python-igraph/tmp/igraph.dZXTk4/igraph-0.7.1'
Makefile:382: recipe for target 'all' failed
make: *** [all] Error 2

Extracting igraph-0.7.1.tar.gz...
Configuring igraph...
Could not download and compile the C core of igraph.
Run Code Online (Sandbox Code Playgroud)

libxml2似乎已安装(即apt-get install libxml2没有安装任何东西),那么如何解决这些问题?

无论如何,我可能会编写自己的图形类,因为我怀疑这比解决上述问题要快...

cas*_*cas 8

libxml2是运行时共享库​​,适用于运行使用该库的已编译程序。如果要编译使用的程序,则libxml2需要安装libxml2-dev.

对于 ubuntu(以及 debian、mint 等。RH 和其他人具有类似约定)上的大多数库包都是如此 -libfoo是运行时共享库​​,libfoo-dev包含开发头文件和 .a 存档

对于 libz,包是 zlib1g-dev

顺便说一句,python-igraph0.6.5-1 是为 debian 打包的——你确定它不是也为 ubuntu 预先打包的吗?如果是这样,您最好安装 ubuntu 软件包。