安装python-ldap

执行如下命令安装python-ldap

python -m pip install python-ldap

报错如下:

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for python-ldap
Failed to build python-ldap
ERROR: Could not build wheels for python-ldap, which is required to install pyproject.toml-based projects

提示安装所依赖的包没有安装。
执行如下命令:(只适用于debian系统,其他系统参考https://www.python-ldap.org/en/latest/installing.html#build-prerequisites)

# apt-get install build-essential python3-dev \
    libldap2-dev libsasl2-dev slapd ldap-utils tox \
    lcov valgrind

在python下输入import ldap查看没有报错即安装成功。

你可能感兴趣的:(python,ldap)