执行以下命令时:
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
其他回答
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
对于ArchLinux/Manjaro,为我提供了以下命令:
yay libldap24
修正由于安装python-ldap依赖关系导致的错误:Windows 7/10
下载WHL文件
http://www.lfd.uci.edu/ gohlke pythonlibs / # python-ldap。
Python 3.6套装
python_ldap-3.2.0-cp36-cp36m-win_amd64.whl
将文件部署到:
c:\python36\Scripts\
使用
python -m pip install python_ldap-3.2.0-cp36-cp36m-win_amd64.whl
Python -ldap基于OpenLDAP,因此需要有开发文件(头文件)才能编译Python模块。如果你用的是Ubuntu,这个包叫做libldap2-dev。
Debian/Ubuntu:
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
RedHat /被久远。
sudo yum install python-devel openldap-devel
截至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