python_ldap install failure on windows using whl file

172 Views Asked by At

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.

0

There are 0 best solutions below