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
Splitting a Pandas Dataframe Column by Delimiter
Index of Duplicates Items in a Python List
Is There a Matplotlib Equivalent of Matlab's Datacursormode
Check If a File Is Not Open Nor Being Used by Another Process
Why Doesn't a Python Dict.Update() Return the Object
Get a Function Argument's Default Value
Pycharm Doesn't Recognise Installed Module
Splitting a List Based on a Delimiter Word
Python: Urlerror: <Urlopen Error [Errno 10060]
Cannot Concatenate 'Str' and 'Float' Objects
Sorting a List of Dot-Separated Numbers, Like Software Versions
How to Avoid Explicit 'Self' in Python
Naturally Sorting Pandas Dataframe