python-ldap is supporting the Python2 and Python3. But I never tried to install on OS X.
I got error message, when I try to install the python-ldap via pip
pip install python-ldap
...
Modules/LDAPObject.c:18:10: fatal error: 'sasl.h' file not found
#include <sasl.h>
^
1 error generated.
error: command 'cc' failed with exit status 1
The official python-ldap site(https://www.python-ldap.org/download.html) is having the guide to install on OS X
Set up a suitable development environment by running xcode-select --install. After that you can install directly from PyPI.
xcode-select --install
xcode-select: note: install requested for command line developer tools
sudo pip install python-ldap
Password:
Collecting python-ldap
Downloading python-ldap-2.4.27.tar.gz (125kB)
100% |████████████████████████████████| 133kB 175kB/s
Requirement already satisfied (use --upgrade to upgrade): setuptools in /Library/Python/2.7/site-packages (from python-ldap)
Installing collected packages: python-ldap
Running setup.py install for python-ldap ... done
Successfully installed python-ldap-2.4.27
python -c "import ldap; print(ldap)"
Comments !