Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named 'ldap' Python 3.5

Tags:

python

ldap

I'm running Python 3.5 (on Windows) and I have installed python-ldap from https://pypi.python.org/pypi/python-ldap/

I also tried using ldap3 but I keep getting an error saying

"ImportError: No module named 'ldap'

I looked around and saw some people saying there's no python-ldap for 3.5 so I installed 2.6 still getting the same error.

Is there a way to import ldap and make it work for Python 3.5?

like image 340
Varda Elentári Avatar asked Jun 05 '17 15:06

Varda Elentári


2 Answers

Try the command below:

sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
sudo pip3 install pyldap
like image 144
Er.Ankit H Gandhi Avatar answered Nov 01 '22 12:11

Er.Ankit H Gandhi


Open a command line(cmd, powershell, git bash) Check you python version $ pyhton --version

Go to https://www.lfd.uci.edu/~gohlke/pythonlibs/

Download the library according with your python version and windows system And install it on a command line using pip install file_downloaded.whl

For example: If you have python 3.5x and windows x64, download the file python_ldap‑3.2.0‑cp35‑cp35m‑win_amd64.whl

pip install python_ldap‑3.2.0‑cp35‑cp35m‑win_amd64.whl

like image 24
Antonio Ortega Avatar answered Nov 01 '22 11:11

Antonio Ortega