Ubuntu 11 に easy_install を使用して lxml をインストールするのが困難です。
入力すると$ easy_install lxml
次のようになります:
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.3
Downloading http://lxml.de/files/lxml-2.3.tgz
Processing lxml-2.3.tgz
Running lxml-2.3/setup.py -q bdist_egg --dist-dir /tmp/easy_install-7UdQOZ/lxml-2.3/egg-dist-tmp-GacQGy
Building lxml version 2.3.
Building without Cython.
ERROR: /bin/sh: xslt-config: not found
** make sure the development packages of libxml2 and libxslt are installed **
Using build configuration of libxslt
In file included from src/lxml/lxml.etree.c:227:0:
src/lxml/etree_defs.h:9:31: fatal error: libxml/xmlversion.h: No such file or directory
compilation terminated.
libxslt
またはがインストールされていないようですlibxml2
。次の手順に従ってみました。http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.phpそしてhttp://www.techsww.com/tutorials/libraries/libxml/installation/installing_libxml_on_ubuntu_linux.php成功しませんでした。
試してwget ftp://xmlsoft.org/libxml2/libxml2-sources-2.6.27.tar.gz
みたら
<successful connection info>
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /libxml2 ... done.
==> SIZE libxml2-sources-2.6.27.tar.gz ... done.
==> PASV ... done. ==> RETR libxml2-sources-2.6.27.tar.gz ...
No such file `libxml2-sources-2.6.27.tar.gz'.
最初に他の方法を試すと、./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2
最終的には失敗します。
checking for libxml libraries >= 2.6.27... configure: error: Could not find libxml2 anywhere, check ftp://xmlsoft.org/.
と の両方のバージョンを試しました2.6.27
が、違いはありませんでし2.6.29
たlibxml2
。
あらゆる手段を尽くして、私は成功しましたがsudo apt-get install libxml2-dev
、これによって何も変わりません。
ベストアンサー1
Ubuntu を使用している場合は、ソース パッケージを気にする必要はありません。apt-get を使用して開発パッケージをインストールするだけです。
apt-get install libxml2-dev libxslt1-dev python-dev
もし、古いバージョンのlxmlで満足できるのであれば、以下を試してみてください。
apt-get install python-lxml
そして、それを終わらせます。:)