Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup.py: install lxml with Python2.6 on CentOS

People also ask

What is lxml package?

lxml is a Python library which allows for easy handling of XML and HTML files, and can also be used for web scraping. There are a lot of off-the-shelf XML parsers out there, but for better results, developers sometimes prefer to write their own XML and HTML parsers.

What is the latest version of lxml?

The latest version is lxml 4.9. 1, released 2022-07-01 (changes for 4.9. 1). Older versions are listed below.

How install lxml in Linux?

Open your Linux terminal or shell. Type “ pip install lxml ” (without quotes), hit Enter. If it doesn't work, try "pip3 install lxml" or “ python -m pip install lxml “.

How do I get lxml version?

In case you want to use the current in-development version of lxml, you can get it from the github repository at https://github.com/lxml/lxml . Note that this requires Cython to build the sources, see the build instructions on the project home page.


I had the same issue, I managed to install it after installing the package libxslt-devel and python-devel which seems to be your problem:

yum install libxslt-devel python-devel

python setup.py install

Installed /usr/lib/python2.6/site-packages/lxml-2.2.8-py2.6-linux-i686.egg
Processing dependencies for lxml==2.2.8
Finished processing dependencies for lxml==2.2.8

However since I also installed other packages in the process, you might want to double check libxml2, libxml2-devel and libxslt while you are at it.

Here is some information on how to build lxml: http://lxml.de/build.html


It solved my problem for nokogiri in Centos

sudo yum install -y gcc ruby-devel libxml2 libxml2-devel libxslt libxslt-devel