执行以下命令时:

sudo pip install python-ldap

我得到这个错误:

在Modules/LDAPObject.c:9包含的文件中: Modules/errors.h:8:致命错误:lber.h:没有这样的文件或目录

有什么解决办法吗?


当前回答

对于使用alphine linux的用户, Apk添加openldap-dev

其他回答

try:

ARCHFLAGS="-arch x86_64" pip3 install python-ldap

对于使用alphine linux的用户, Apk添加openldap-dev

在openSUSE上需要安装openldap2-devel、cyrus-sasl-devel、python-devel和libopenssl-devel。

Zypper安装openldap2-devel cyrus-sasl-devel python-devel libopenssl-devel

sudo apt-get install build-essential python3-dev python2.7-dev libldap2-dev libsasl2-dev slapd ldap-utils python-tox lcov valgrind

Debian参考: https://www.python-ldap.org/en/latest/installing.html#debian 其他信息:https://www.python-ldap.org/en/latest/installing.html

用于阿尔卑斯码头

apk add openldap-dev

如果python版本是3及以上,请尝试

pip install python3-ldap