微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

software-installation – 如何在为python安装’igraph’时修复“找不到-lxml2”错误?

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

pip install python-igraph

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

/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.

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

我可能会编写自己的图表类,因为我怀疑这比解决上述问题更快…

解决方法:

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

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

对于libz,包是zlib1g-dev

BTW,python-igraph 0.6.5-1是为debian打包的 – 你确定它还没有为ubuntu预先打包吗?如果是的话,你最好安装ubuntu软件包.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。