执行以下命令时:
sudo pip install python-ldap
我得到这个错误:
在Modules/LDAPObject.c:9包含的文件中: Modules/errors.h:8:致命错误:lber.h:没有这样的文件或目录
有什么解决办法吗?
执行以下命令时:
sudo pip install python-ldap
我得到这个错误:
在Modules/LDAPObject.c:9包含的文件中: Modules/errors.h:8:致命错误:lber.h:没有这样的文件或目录
有什么解决办法吗?
当前回答
截至2021年12月,ldap库出现了一个奇怪的问题(至少在arch/manjaro中)。
在安装python-ldap(在'Building wheel for python-ldap')时,我收到消息'ERROR: Failed Building wheel for python-ldap':
/usr/bin/ld: cannot find -lldap_r
collect2: error: ld returned 1 exit status
error: command '/usr/bin/gcc' failed with exit code 1
这里提供了一个解决方案:https://github.com/python-ldap/python-ldap/issues/432#issuecomment-974799221
我引用:
作为解决方案,创建文件/usr/lib64/libldap_r.关于内容 输入(libldap。)。这种方法适用于所有使用GNU的系统 ld-compatible链接器。 # cat > /usr/lib64/libldap_r.so << EOF 输入(libldap。) EOF
其他回答
截至2021年12月,ldap库出现了一个奇怪的问题(至少在arch/manjaro中)。
在安装python-ldap(在'Building wheel for python-ldap')时,我收到消息'ERROR: Failed Building wheel for python-ldap':
/usr/bin/ld: cannot find -lldap_r
collect2: error: ld returned 1 exit status
error: command '/usr/bin/gcc' failed with exit code 1
这里提供了一个解决方案:https://github.com/python-ldap/python-ldap/issues/432#issuecomment-974799221
我引用:
作为解决方案,创建文件/usr/lib64/libldap_r.关于内容 输入(libldap。)。这种方法适用于所有使用GNU的系统 ld-compatible链接器。 # cat > /usr/lib64/libldap_r.so << EOF 输入(libldap。) EOF
对于使用alphine linux的用户, Apk添加openldap-dev
对于那些在Alpine Linux上丢失Iber.h的人,例如,在您试图适应Alpine的docker映像中。
您正在寻找的包是:openldap-dev
所以运行
Apk添加openldap-dev
从3.3版本到Edge版本均可用
适用于armhf和x86_64架构。
对于大多数系统,现在python-ldap文档中的“安装”部分提到了构建需求。
如果您的系统缺少任何东西(或者您的系统完全缺少),请让维护者知道! (截至2018年,我是维护者,所以这里的评论应该足够了。或者你可以发送一个请求或邮件。)
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