在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软件包.