kakwa / ldapcherry

Web UI for managing users and groups in multiple directory services.
MIT License
225 stars 70 forks source link

pip install ldapcherry - fatal error: Python.h: No such file or directory #35

Open vishwakumba opened 5 years ago

vishwakumba commented 5 years ago

OS = Centos 7.x Python = 2.7.5

$ pip install ldapcherry

This is producing the foll. error :

gcc -pthread -fno-strict-aliasing -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 -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 -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=3.2.0 -DLDAPMODULE_AUTHOR=python-ldap project -DLDAPMODULE_LICENSE=Python style -IModules -I/usr/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o In file included from Modules/LDAPObject.c:3:0: Modules/common.h:9:20: fatal error: Python.h: No such file or directory

include "Python.h"

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

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

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

vishwakumba commented 5 years ago

The workaround that I found was to install python-devel package. This seems to fix the error.

$ yum install -y python-devel

smacz42 commented 5 years ago

This is the correct fix as can be found here: https://gitlab.com/smacz/docker-ldapcherry/blob/andrewcz-homelab-179/Dockerfile

Should this be closed @kakwa ?

vishwakumba commented 5 years ago

If this can be mentioned in the document somewhere (maybe prerequisites), it could be useful for people coming from a non-python background.