How do I install lxml on Ubuntu?

Asked 1 years ago, Updated 1 years ago, 88 views

I'm using easy_install to install lxml on Ubuntu 11 I keep getting errors.

If you use $easy_installlxml

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.

I think it's a problem because there's no libxslt or libxml2 http://www.techsww.com/tutorials/libraries/libxslt/installation/installing_libxslt_on_ubuntu_linux.php and http://www.techsww.com/tutorials/libraries/libxml/installation/installing_libxml_on_ubuntu_linux.I did what you told me to do on php, but I can't do this either.

If you write 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'.

I tried both versions of libxml2 2.6.27 and 2.6.29 but neither of them worked.

Somehow sudo apt-get install libxml2-dev was successful, but nothing changed. What should I do in this case?

python ubuntu lxml libxml2 easy-install

2022-09-22 10:49

1 Answers

When working with Ubuntu, it is better to use apt-get than easy_install for package installation.

apt-get install python-lxml and apt-get install the required package together.

If you want to install a specific package as an old version, please specify the following version apt-get install libxml2-dev libxslt1-dev python-dev


2022-09-22 10:49

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.