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 ?
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
Related
Trying to install pip package fastavro==0.23.4 on linux rhel 7.8 but getting error:
creating build/temp.linux-x86_64-3.6/fastavro
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c fastavro/_read.c -o build/temp.linux-x86_64-3.6/fastavro/_read.o
fastavro/_read.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-p3u2ii2c/fastavro/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-57h05ysx-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-p3u2ii2c/fastavro/
I already have python3 devel packages:
yum list installed|grep -i devel|grep -i python
python-devel.x86_64 2.7.5-88.el7 #rhui-rhel-7-server-rhui-rpms
rh-python36-python-devel.x86_64 3.6.9-2.el7 #rhui-rhel-server-rhui-rhscl-7-rpms
rh-python38-python-devel.x86_64 3.8.0-15.el7 #rhui-rhel-server-rhui-rhscl-7-rpms
How can I resolve this ?
Fixed this issue by manually downloading package: "python3-devel-3.6.8-13.el7.x86_64.rpm" on my rhel machine, installing it using yum and running the pyhton3 pip install again.
system info :
Ubuntu 14.10
Linux vagrant-ubuntu-trusty 3.16.0-23-generic #31-Ubuntu SMP Tue Oct 21 17:56:17 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I first install virtualenv in ubuntu
sudo pip install virtualenv
virtualenv scrapy-env
cd scrapy-env/
source bin/activate
pip install scrapy
then I get this error:
running build_ext
building 'twisted.test.raiser' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/twisted
creating build/temp.linux-x86_64-2.7/src/twisted/test
x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/twisted/test/raiser.c -o build/temp.linux-x86_64-2.7/src/twisted/test/raiser.o
src/twisted/test/raiser.c:4:20: fatal error: Python.h: No such file or directory
#include "Python.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/vagrant/pyenv/scrapy-env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-NJKTtN/Twisted/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-_i2ueH-record/install-record.txt --single-version-externally-managed --compile --install-headers /vagrant/pyenv/scrapy-env/include/site/python2.7/Twisted" failed with error code 1 in /tmp/pip-build-NJKTtN/Twisted/
Any suggestions that could help me fix it?
You don't have Python developer package installed. Try installing them
sudo apt-get install python-dev # for python2.x installs
sudo apt-get install python3-dev # for python3.x installs
So I am trying to install Pyv8 by following instruction from https://andrewwilkinson.wordpress.com/2012/01/23/integrating-python-and-javascript-with-pyv8/
sudo aptitude install scons libboost-python-dev
svn checkout http://v8.googlecode.com/svn/trunk/ v8
svn checkout http://pyv8.googlecode.com/svn/trunk/ pyv8
cd v8
export PyV8=`pwd`
cd ../pyv8
python setup.py build
sudo python setup.py install
Error comes when running second last command about building the setup.
-Wstrict-prototypes -fPIC -DBOOST_PYTHON_STATIC_LIB -
DV8_NATIVE_REGEXP -DENABLE_DEBUGGER_SUPPORT -DV8_TARGET_ARCH_X64 -
I/home/amit/Downloads/pyv8/build/v8_r19632/include -
I/home/amit/Downloads/pyv8/build/v8_r19632 -
I/home/amit/Downloads/pyv8/build/v8_r19632/src -I/usr/local/include -
I/usr/include/python2.7 -c src/PyV8.cpp -o build/temp.linux-x86_64-
2.7/src/PyV8.o -Wno-write-strings -g -O3
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for
C/ObjC but not for C++ [enabled by default]
c++ -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-
functions -Wl,-z,relro -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall
-Wstrict-prototypes -D_FORTIFY_SOURCE=2 -g -fstack-protector --param=ssp-
buffer-size=4 -Wformat -Werror=format-security build/temp.linux-x86_64-
2.7/src/Utils.o build/temp.linux-x86_64-2.7/src/Exception.o
build/temp.linux-x86_64-2.7/src/Context.o build/temp.linux-x86_64-
2.7/src/Engine.o build/temp.linux-x86_64-2.7/src/Wrapper.o
build/temp.linux-x86_64-2.7/src/Debug.o build/temp.linux-x86_64-
2.7/src/Locker.o build/temp.linux-x86_64-2.7/src/AST.o build/temp.linux-
x86_64-2.7/src/PrettyPrinter.o build/temp.linux-x86_64-2.7/src/PyV8.o
L/usr/local/lib -
L/home/amit/Downloads/pyv8/build/v8_r19632/out/x64.release/obj.target/tool
s/gyp/ -lboost_python -lboost_thread -lboost_system -lrt -lv8_base.x64 -
lv8_snapshot -o build/lib.linux-x86_64-2.7/_PyV8.so -fPIC -lrt
/usr/bin/ld: cannot find -lboost_thread
/usr/bin/ld: cannot find -lboost_system
collect2: error: ld returned 1 exit status
error: command 'c++' failed with exit status 1
It is because the version of gcc and g++ is too low for me, as I downgrade it when i install cuda sometime. Just follow the following commands:
$ cd /usr/bin
$ rm gcc
$ ln -s gcc-5 gcc
$ rm g++
$ ln -s g++-5 g++
Done.
I followed the instructions from this link - http://ubuntuforums.org/showthread.php?t=1480282#post_11247864
and installed the libboost_thread package which solved the problem. Thank you https://stackoverflow.com/users/440558/joachim-pileborg
here is my error when I try to install gevent-socketio
Installing collected packages: gevent, greenlet
Running setup.py install for gevent
building 'gevent.core' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes >-fPIC -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CHECK_ENABLE=0 -DEV_CLEANUP_ENABLE=0 >-DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.linux-x86_64-2.7/libev -Ilibev >-I/usr/include/python2.7 -c gevent/gevent.core.c -o build/temp.linux-x86_64-2.7/gevent/gevent.core.o
gevent/gevent.core.c:17:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;file='/var/www/bleu/build/gevent/setup.py';exec(compile(open(file).read().replace('\r\n', '\n'), file, 'exec'))" install --single-version-externally-managed --record /tmp/pip-_kv6Fy-record/install-record.txt:
running install
running build
running build_py
running build_ext
building 'gevent.core' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC > -DLIBEV_EMBED=1 -DEV_COMMON= -DEV_CHECK_ENABLE=0 -DEV_CLEANUP_ENABLE=0 -DEV_EMBED_ENABLE=0 -DEV_PERIODIC_ENABLE=0 -Ibuild/temp.linux-x86_64-2.7/libev -Ilibev -I/usr/include/python2.7 -c gevent/gevent.core.c -o build/temp.linux-x86_64-2.7/gevent/gevent.core.o
gevent/gevent.core.c:17:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Have you an idea how i can fix this?
Install the Development Package(s):
CentOS/RHEL::
yum install python-devel
Debian/Ubuntu:
apt-get install python-dev
Terminal Error Return
root#sys:~/Downloads/PIL-fork-1.1.7-py3# python3 setup.py build
running build
running build_py
running build_ext
building 'PIL._imaging' extension
gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -fPIC -IlibImaging -I/usr/include -I/usr/local/include -I/usr/include/python3.2mu -c _imaging.c -o build/temp.linux-x86_64-3.2/_imaging.o
_imaging.c:75:20: fatal error: Python.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
root#sys:~/Downloads/PIL-fork-1.1.7-py3#
this file are downloaded from http://www.lfd.uci.edu/~gohlke/pythonlibs/#pil
how to install this Aspell PIL Python 3?
Following below step to complete install PIL
sudo aptitude install python3-setuptools
sudo easy_install3 pip
sudo apt-get install python3-dev
download the Pillow-master.zip
wget https://github.com/python-imaging/Pillow/archive/master.zip
go to downloaded directory and,
sudo unzip Pillow-master.zip
python3 setup.py build
python3 setup.py install