G
G
gadzhi152016-04-19 14:27:49
Python
gadzhi15, 2016-04-19 14:27:49

Installing lxml on CentOS. How to overcome the error?

Installed Python 2.7 on CentOS 6.7 minimal. Registered PATH. Installed pip. When you enter the pip install lxml command, you will get an error:

Compile failed: command 'gcc' failed with exit status 1
cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitC7CEI7.c -o tmp/xmlXPathInitC7CEI7.o
/tmp/xmlXPathInitC7CEI7.c:1:26: error: libxml /xpath.h: No such file or directory
**************************************** *****************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
******************************************************* *******************************
error: command 'gcc' failed with exit status 1
-------- --------------------------------
Command "/usr/local/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-K8ZHxF/lxml/setup.py';exec(compile(getattr(tokenize, ' open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-zCOkGl-record/install -record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-K8ZHxF/lxml/

GCC installed. Required development tools packages are installed

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
gadzhi15, 2016-04-19
@gadzhi15

Resolved the issue. First did this:
Then like this:
pip install lxml

R
Rostislav Grigoriev, 2016-04-19
@crazyzubr

Try

apt-get install libxml2-dev
apt-get install libxslt1-dev
pip install lxml

or
easy_install lxml

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question