I Can't Install Python-Ldap

I can't install python-ldap

The python-ldap is based on OpenLDAP, so you need to have the development files (headers) in order to compile the Python module. If you're on Ubuntu, the package is called libldap2-dev.

Debian/Ubuntu:

sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev

RedHat/CentOS:

sudo yum install python-devel openldap-devel

python-ldap 3.4 installation fails on alpine images

There are issues with the python-ldap package when linking against OpenLDAP 2.5+. The issues are acknowledged by the devs in https://github.com/python-ldap/python-ldap/issues/432 and https://github.com/python-ldap/python-ldap/issues/445.

Tested workaround is the one described in the first issue:

As a workaround create the file /usr/lib64/libldap_r.so with content
INPUT ( libldap.so ). The approach works on all systems that use a GNU
ld-compatible linker.

 # cat > /usr/lib64/libldap_r.so << EOF
INPUT ( libldap.so )
EOF

You can also use it in a simpler way (in Dockerfiles, for example):

echo -n "INPUT ( libldap.so )" > /usr/lib/libldap_r.so


Related Topics



Leave a reply



Submit