ndparker / rjsmin

Fast javascript minifier for Python
http://opensource.perlig.de/rjsmin/
Apache License 2.0
60 stars 15 forks source link

Pip Install RJSMIN Fails on AWS EC2 #12

Closed artforlife closed 6 years ago

artforlife commented 7 years ago

When I try to install rjsmin into a virtualenv on a basic EC2 instance, it fails with the following code:

gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DDYNAMIC_ANNOTATIONS_ENABLED=1 -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 -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.5m -c rjsmin.c -o build/temp.linux-x86_64-3.5/rjsmin.o In file included from rjsmin.c:18:0: _setup/include/cext.h:34:20: fatal error: Python.h: No such file or directory

include "Python.h"

                  ^

compilation terminated. error: command 'gcc' failed with exit status 1


Failed building wheel for rjsmin Running setup.py clean for rjsmin Failed to build rjsmin Installing collected packages: rjsmin Running setup.py install for rjsmin ... error Complete output from command /var/www/vhosts/kindbook/kindbook-env/bin/python3 -u -c "import setuptools, tokenize;file='/tmp/pip-build-67dkt6wf/rjsmin/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-65tdntz3-record/install-record.txt --single-version-externally-managed --compile --install-headers /var/www/vhosts/kindbook/kindbook-env/include/site/python3.5/rjsmin: running install running build running build_py creating build creating build/lib.linux-x86_64-3.5 copying ./rjsmin.py -> build/lib.linux-x86_64-3.5 running build_ext building '_rjsmin' extension creating build/temp.linux-x86_64-3.5 gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DDYNAMIC_ANNOTATIONS_ENABLED=1 -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 -DEXT_MODULE=_rjsmin -UEXT_PACKAGE -I_setup/include -I/usr/include/python3.5m -c rjsmin.c -o build/temp.linux-x86_64-3.5/rjsmin.o In file included from rjsmin.c:18:0: _setup/include/cext.h:34:20: fatal error: Python.h: No such file or directory

include "Python.h"

                    ^
compilation terminated.
error: command 'gcc' failed with exit status 1

Does anyone know what the cause may be?

ndparker commented 7 years ago

You need to install the python-dev(el) package for the missing headers.