The Python Oracle

I can't install python-ldap

--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------

Music by Eric Matyas
https://www.soundimage.org
Track title: Future Grid Looping

--

Chapters
00:00 I Can'T Install Python-Ldap
00:23 Accepted Answer Score 636
00:46 Answer 2 Score 159
01:02 Answer 3 Score 75
01:19 Answer 4 Score 57
01:42 Answer 5 Score 35
01:51 Thank you

--

Full question
https://stackoverflow.com/questions/4768...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #module #ldap #pythonldap

#avk47



ACCEPTED ANSWER

Score 637


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-is-python3 libldap2-dev libssl-dev

Red Hat/CentOS:

sudo yum install python-devel openldap-devel



ANSWER 2

Score 159


To install python-ldap successfully with pip, following development libraries are needed (package names taken from ubuntu environment):

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



ANSWER 3

Score 75


On CentOS/RHEL 6, you need to install:

sudo yum install python-devel
sudo yum install openldap-devel

And YUM will also install cyrus-sasl-devel as a dependency. Then you can run:

pip-2.7 install python-ldap



ANSWER 4

Score 35


In Ubuntu it looks like this:

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