Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
vishwakumba opened this issue Apr 30, 2019 · 3 comments

Comments

@vishwakumba
Copy link

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
Copy link
Author

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

$ yum install -y python-devel

@smacz42
Copy link
Contributor

smacz42 commented Jul 13, 2019

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants