while running a python script, I got this error
from lxml import etree
ImportError: No module named lxml
now I tried to install lxml
For RHEL/CentOS, run "python --version" command to find out Python version. E.g. below:
$ python --version
Python 2.7.12
Now run "sudo yum search lxml" to find out python*-lxml package.
$ sudo yum search lxml
Failed to set locale, defaulting to C
Loaded plugins: priorities, update-motd, upgrade-helper
1014 packages excluded due to repository priority protections
============================================================================================================= N/S matched: lxml =============================================================================================================
python26-lxml-docs.noarch : Documentation for python-lxml
python27-lxml-docs.noarch : Documentation for python-lxml
python26-lxml.x86_64 : ElementTree-like Python bindings for libxml2 and libxslt
python27-lxml.x86_64 : ElementTree-like Python bindings for libxml2 and libxslt
Now you can choose package as per your Python version and run command like below:
$ sudo yum install python27-lxml.x86_64