0

The python_ldap package for windows 10 fails to install on my windows laptop. It exits with error C1083: mysql.h not found. So I adjusted the path order to place the location of this file closer to the front of the path.

I am using a wheel file from https://www.lfd.uci.edu/~gohlke/pythonlibs/#python-ldap to install: python_ldap-3.4.0-cp311-cp311-win_amd64
(The wheel file was unzipped with 7-zip.)

Running pip install on this local directory fails with the following:

"c:\Program Files\Python311\scripts\pip" install python_ldap-3.4.0-cp311-cp311-win_amd64 --no-cache --use-wheel python_ldap

C:\Users\jw708\AppData\Local\Temp\pip-install-lvwb_4z3\python-ldap_33030b515612408fba3ae0d6f676d1ce\Modules\common.h(15): fatal error C1083: Cannot open include file: 'lber.h': No such file or directory error: command 'C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\HostX86\x64\cl.exe' failed with exit code 2

Looks to me like Visual Studio is confounding this problem. I don't want to uninstall VS just to install a python package for LDAP. However, installation of the python_ldap package seems unnecessarily complicated.

Is there a python LDAP package that can be installed with a simple 'pip install python_ldap'? The wheel files are not working out.

The other option I have is to remove LDAP from the python project entirely--not the best choice.

Joe White DFCI

pip install wheel wheel unpack python_ldap-3.4.0-cp311-cp311-win_amd64.whl pip install python_ldap-3.4.0

Result: ERROR: Could not find a version that satisfies the requirement python_ldap-3.4.0 (from versions: none) ERROR: No matching distribution found for python_ldap-3.4.0

Also tried this:

C:\Users\jw708\Documents\Gain\test>"c:\Program Files\Python311\scripts\pip" install -e python_ldap-3.4.0

Result:

Obtaining file:///C:/Users/jw708/Documents/Gain/test/python_ldap-3.4.0 ERROR: file:///C:/Users/jw708/Documents/Gain/test/python_ldap-3.4.0 does not appear to be a Python project: neither 'setup.py' nor 'pyproject.toml' found.

2 Answers 2

0

I solved this issue by first making sure pip setuptools and wheel were up to date.

pip install --upgrade pip setuptools wheel

if the installation still fails after this, you can check the supported wheel version tags using the command:

pip debug --verbose

you can then cross reference the compatible tags with the list here: https://github.com/cgohlke/python-ldap-build/releases and download the appropriate version for your computer.

Some helpful links:

And I agree; the installation process can get quite tedious for first timers like it is with other things in programming, it's part of the game 😅

Sign up to request clarification or add additional context in comments.

Comments

0

This is how you can download the python-ldap

This happen because in windows we are unable install the python-ldap directly hence we have to install it from other sources. There are multiple files in that repo based on different devices download the files which suits your device configurations

  1. Download the .whl file from this repo according to your device

  2. Then : pip install <path of .whl file>

  3. This will install the python-ldap

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.