Q & A

Am dificultati la instalarea LXML cu easy_install pe Ubuntu 11.

Cand incerc $ 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.

Se pare ca libxsltsau libxml2 nu este instalat. Am incercat urmand instructiunile de la http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.php si http://www.techsww.com/tutorials/libraries/libxml/installation/installing_libxml_on_ubuntu_linux. php fara succes.

Daca incerc 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'.

Daca incerc cealalta prima, voi ajunge ./configure --prefix=/usr/local/libxslt --with-libxml-prefix=/usr/local/libxml2si ca nu va reusi in cele din urma cu:

checking for libxml libraries >= 2.6.27... configure: error: Could not find libxml2 anywhere, check ftp://xmlsoft.org/.

Am incercat ambele versiuni 2.6.27si 2.6.29de libxml2 - nici o diferenta.

Am incercat fara succes sudo apt-get install libxml2-dev, - nu schimba nimic.

  • GNU/Linux.ro
  • 5 years ago

Trebuie doar sa instalati acele pachete de dezvoltare folosind apt-get.

apt-get install libxml2-dev libxslt1-dev python-dev

Daca sunteti multumit cu o versiune mai veche, eventual ai putea incerca

apt-get install python-lxml