Install Python LDAP on Linux

Posted Under: CentOS, Configuration, Linux, Python, Snippets on Jun 17, 2019
Linux snippet to install Python LDAP on various Linux distributions.

Python LDAP on Debian

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

Python LDAP on CentOS

sudo yum install python-devel openldap-devel

Python LDAP on Fedora

sudo dnf install python-devel openldap-devel

Python LDAP on OpenSUSE

zypper install openldap2-devel  cyrus-sasl-devel python-devel libopenssl-devel

Python LDAP on Alpine Linux

apk add build-base openldap-dev python2-dev python3-dev

Python LDAP on FreeBSD

pkg install openldap-client 
pkg install cyrus-sasl 
pip install python-ldap

Python LADP on Windows

To install Python LDAP on Windows download one of the pre-built packages (wheels) form here. After the successful installation of the above mentioned pre-requisites according to your environment run to following command.
python -m pip install python-ldap