Python用の「igraph」をインストールするときに「-lxml2が見つかりません」エラーを修正する方法は?

Python用の「igraph」をインストールするときに「-lxml2が見つかりません」エラーを修正する方法は?

Ubuntu 15.04では、次のコマンドを使用して「igraph」をインストールしようとしました。

pip install python-igraph

まあ、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.

libxml2インストールされているようです(つまり、apt-get install libxml2何もインストールされていません)。これらの問題を解決するにはどうすればよいですか?

とにかく、私は上記の問題を解決するよりも速いと思うので、おそらく私自身のグラフィッククラスを書くでしょう。

ベストアンサー1

libxml2ライブラリを使用してコンパイルされたプログラムを実行するのに適したランタイム共有ライブラリ。プログラムをコンパイルして使用するにはlibxml2インストールが必要ですlibxml2-dev

これはUbuntu(そしてDebian、Mintなど)のほとんどのライブラリパッケージに当てはまります。 RHや他のライブラリにも同様の規則があります。開発ヘッダーと.aアーカイブを含むlibfooランタイム共有ライブラリ。libfoo-dev

libzの場合、パッケージは次のようになります。zlib1g-dev

ところで、python-igraph0.6.5-1はDebian用にパッケージされています。 Ubuntu用にあらかじめパッケージされていないことは確実ですか?その場合は、Ubuntuパッケージをインストールすることをお勧めします。

おすすめ記事