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: lber.h: No such file or directory #36

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

Comments

@vishwakumba
Copy link

OS : Centos 7.2
Python : 2.7.5
ldapcherry : 1.1.1

I obtained the foll. error while installing ldapcherry.

$ pip install ldapcherry

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:8:0:
Modules/constants.h:7:18: fatal error: lber.h: No such file or directory
#include "lber.h"
^
compilation terminated.
error: command 'gcc' failed with exit status 1

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

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

@vishwakumba
Copy link
Author

I was able to resolve this issue by the foll. workaround :

$ yum install -y yum-utils
$ yum-builddep -y python-ldap
$ pip install -U python-ldap

@kakwa
Copy link
Owner

kakwa commented May 3, 2019

Actually, it's not a work around, it's the proper way to do it if you are installing the dependencies through pip (python-ldap and python-yaml are bindings to C libraries, these needs to be compiled, so you need the headers and a compiler).

I need to specify if in the documentation.

Also, the ldapcherry dependency are already packaged by CentOS (with Epel) and Debian/Ubuntu, I should probably mention it and document it, it will be less fragile than pip.

@smacz42
Copy link
Contributor

smacz42 commented Jul 16, 2019

If you're installing on CentOS and already have pip, then the following should work:

$ sudo yum install python-devel gcc openldap-devel

But it seems that you want three things in the documentation:

  1. Install ldapcherry through pip
  2. Install dependencies through OS package management and install ldapcherry with pip
  3. Install dependencies through OS package management and run setup.py

Would you like this before "From the sources" in install.rst?

@vishwakumba
Copy link
Author

Yes please - thanks. :)-

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

3 participants