2017-06-03 67 views
1

我試圖在centos(amazon linux AMI)上安裝LXML。在安裝lxml期間python gcc和setuptools錯誤

我已經安裝了以下prereqs:

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

然後我安裝與LXML:

sudo pip install lxml 

我得到以下的gcc錯誤:

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

我的gcc版本是: gcc(GCC)4.8.3 20140911(Red Hat 4.8.3-9)

我的python版本是: Python 2.7.12

我怎樣才能通過這個錯誤來安裝LXML?

回答

0

我安裝的那些我上面提到的:

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

而這兩個的伎倆:

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



sudo pip install lxml