1
votes

I am trying to install LXML on centos (amazon linux AMI).

I have installed the following prereqs:

sudo yum install libxml2-devel libxslt-devel
sudo yum install zlib-devel
sudo pip install setuptools
sudo yum install python-devel

I then install lxml with:

sudo pip install lxml

I get the following gcc error:

creating build/temp.linux-x86_64-2.7/src/lxml gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.linux-x86_64-2.7/src/lxml/lxml.etree.o -w {standard input}: Assembler messages: {standard input}:593226: Error: unknown pseudo-op: `.lc1' gcc: internal compiler error: Killed (program cc1) Please submit a full bug report, with preprocessed source if appropriate. See http://bugzilla.redhat.com/bugzilla for instructions. Compile failed: command 'gcc' failed with exit status 4 creating tmp cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInit0HczkK.c -o tmp/xmlXPathInit0HczkK.o cc tmp/xmlXPathInit0HczkK.o -L/usr/lib64 -lxml2 -o a.out error: command 'gcc' failed with exit status 4

----------------------------------------

Command "/usr/bin/python2.7 -c "import setuptools, tokenize;file='/tmp/pip-build-TmaL5z/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-OD8Xpx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-TmaL5z/lxml

My gcc version is: gcc (GCC) 4.8.3 20140911 (Red Hat 4.8.3-9)

My python version is: Python 2.7.12

How can I get past this error to install LXML ?

1

1 Answers

0
votes

I installed those I mentioned above:

sudo yum install libxml2-devel libxslt-devel
sudo yum install zlib-devel
sudo pip install setuptools
sudo yum install python-devel

And these two did the trick:

sudo yum install glibc-devel glibc-headers
Sudo yum groupinstall "Development tools”



sudo pip install lxml