当我运行以下命令时:
sudo pip install python-ldap
我收到此错误:
In file included from Modules/LDAPObject.c:9:
Modules/errors.h:8: fatal error: lber.h: No such file or directory
任何想法如何解决这个问题?
最佳答案
python-ldap基于 OpenLDAP,因此您需要拥有开发文件(头文件)才能编译 Python 模块。如果您使用的是 Ubuntu,则该软件包称为 libldap2-dev
。
Debian/Ubuntu:
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev
RedHat/CentOS:
sudo yum install python-devel openldap-devel
关于python - 我无法安装 python-ldap,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4768446/