1

I'm using the "import ldap" in a python code. This is on a windows 10 machine. I installed the python-ldap module

pip3 install python-ldap 

Installed the dependencies based on the instructions at Python Can't install packages Also resolved all the pip deployment issues based on Installing python-ldap in a virtualenv on Windows I'm now getting the following error when executing the import ldap statement. am I missing something here? Any ideas to resolve it?

thon39\site-packages\ldap\__init__.py", line 34, in <module>
    import _ldap
ImportError: DLL load failed while importing _ldap: The specified module could not be found.

1 Answers1

0

Visit the unofficial Python binaries page:

https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap

Download the appropriate WHL package for your system. For example, if you're using Python 3.8 on an x64 system, download python_ldap‑3.3.1‑cp38‑cp38‑win_amd64.whl

(hint: do NOT download the +sasl version unless you have the Cyrus SASL code running on your system...)

Start the VirtualEnv for your project, if you're using one (C:\Users\youruser\.virtualenv\YourVirtualEnv\Scripts\activate.bat) -- if you're not, skip this step.

Then run pip3 install C:\Path\To\python_ldap_x.x.x-cpXX-cpXX-winXX.whl and this should install the Python DLL (pyd) file for you.

Pretzel
  • 8,141
  • 16
  • 59
  • 84