When doing AD domain controlled LDAP authentication, if you want to use Python to synchronize LDAP data, you need to use Python_Ldap component.
By https://www.lfd.uci.edu/ ~Gohlke/pythonlibs/# python ldap downloaded the latest version.

Run installation.
C:UsersNicoDownloads>pip install python_ldap-3.2.0-cp38-cp38m-win_amd64.whl
The following error occurred.
C:UsersNico>pip install python_ldap‑3.2.0‑cp38‑cp38m‑win_amd64.whl
Requirement 'python_ldap‑3.2.0‑cp38‑cp38m‑win_amd64.whl' looks like a filename, but the file does not exist
python_ldap‑3.2.0‑cp38‑cp38m‑win_amd64.whl is not a valid wheel filename.
You are using pip version 18.1, however version 19.2.1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
This prompt indicates that your local pip version is too low and needs to be upgraded. Please execute the.
python -m pip install --upgrade pip
upgrade.
C:UsersNico>python -m pip install --upgrade pip
Collecting pip
Downloading https://files.pythonhosted.org/packages/62/ca/94d32a6516ed197a491d17d46595ce58a83cbb2fca280414e57cd86b84dc/pip-19.2.1-py2.py3-none-any.whl (1.4MB)
100% |████████████████████████████████| 1.4MB 119kB/s
Installing collected packages: pip
Found existing installation: pip 18.1
Uninstalling pip-18.1:
Successfully uninstalled pip-18.1
Successfully installed pip-19.2.1
C:UsersNico>
Executing pip installation again, there was an error again.
ERROR: python_ldap-3.2.0-cp38-cp38m-win_amd64.whl is not a supported wheel on this platform.
After some searching, it was found that if you did not pay attention to the version and model of Python installed on your local machine that supports the corresponding version of pip, the WHL file for installing the wrong version will appear:
PIP error: is not a supported wheel on this platform.
Solution:
1. View the supported library file versions for native Python.
Wins2.
import pip
print(pip.pep425tags.get_supported())
Through execution, we can conclude that.
C:Python36Libsite-packages>python
Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import pip
>>> print(pip.pep425tags.get_supported())
[('cp36', 'cp36m', 'win32'), ('cp36', 'none', 'win32'), ('py3', 'none', 'win32'), ('cp36', 'none', 'any'), ('cp3', 'none', 'any'), ('py36', 'none', 'any'),<br> ('py3', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), <br> ('py30', 'none', 'any')]
The library file version supported by this host is cp36-cp36m-win32.
But when installing on different hosts, an error occurred after executing this command.
C:UsersNicoDownloads>python
Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pip
>>> print(pip.pep425tags.get_supported())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'pip' has no attribute 'pep425tags'
I compared the previous host and found that besides the different Python versions, there was also a 32-bit system before, and this time it was a 64 bit system. Is this the reason that caused the command to fail?.
After some searching, it was found that the command for viewing supported versions of library files for 64 bit systems is another one.
Win_Amd64.
import pip._internal
print(pip._internal.pep425tags.get_supported())
Obtained after execution.
>>> import pip._internal
>>> print(pip._internal.pep425tags.get_supported())
[('cp37', 'cp37m', 'win_amd64'), ('cp37', 'none', 'win_amd64'), ('py3', 'none', 'win_amd64'), ('cp37', 'none', 'any'), ('cp3', 'none', 'any'), ('py37', 'none', 'any'), ('py3', 'none', 'any'), ('py36', 'none', 'any'), ('py35', 'none', 'any'), ('py34', 'none', 'any'), ('py33', 'none', 'any'), ('py32', 'none', 'any'), ('py31', 'none', 'any'), ('py30', 'none', 'any')]
The supported version of this host library file is cp-37-cp37m-win_Amd64.
Install Python after finding the correct version_Ldap.
C:UsersNicoDownloads>pip install python_ldap-3.2.0-cp37-cp37m-win_amd64.whl
Processing c:usersnicodownloadspython_ldap-3.2.0-cp37-cp37m-win_amd64.whl
Collecting pyasn1>=0.3.7 (from python-ldap==3.2.0)
Downloading https://files.pythonhosted.org/packages/6a/6e/209351ec34b7d7807342e2bb6ff8a96eef1fd5dcac13bdbadf065c2bb55c/pyasn1-0.4.6-py2.py3-none-any.whl (75kB)
|████████████████████████████████| 81kB 4.9kB/s
Collecting pyasn1-modules>=0.1.5 (from python-ldap==3.2.0)
Using cached https://files.pythonhosted.org/packages/be/70/e5ea8afd6d08a4b99ebfc77bd1845248d56cfcf43d11f9dc324b9580a35c/pyasn1_modules-0.2.6-py2.py3-none-any.whl
Installing collected packages: pyasn1, pyasn1-modules, python-ldap
Successfully installed pyasn1-0.4.6 pyasn1-modules-0.2.6 python-ldap-3.2.0
C:UsersNicoDownloads>
Check if the installation was successful by entering the Scripts folder in the Python installation directory and executing a pip list.
D:PythonPython37Scripts>pip list
Package Version
-------------- -------
pip 19.2.1
pyasn1 0.4.6
pyasn1-modules 0.2.6
python-ldap 3.2.0
setuptools 40.6.2
D:PythonPython37Scripts>
Whl installation package precautions for installing PIP on Windows.
1. The installation package version should correspond to the Python version installed on the host and the difference between the host system 32/64.
When executing the pip install command, enter the directory where the installation package is located. Of course, if you don't mind entering a bunch of directory addresses and then adding a file name, this can be ignored.