安装python ldap时出错

安装python ldap时出错,python,unix,python-ldap,Python,Unix,Python Ldap,我在安装python ldap时遇到以下错误。注意,我已经在我的系统上设置了OpenLDAP、berkely db。我遵循的步骤是: tar xvf python-ldap-2.4.10.tar.gz\ cd python-ldap-2.4.10\ #edit setup.cfg\ #library_dirs = /nlu/users/prefix /usr/lib\ #include_dirs = /nlu/users/prefix /usr/include/sasl /usr/include

我在安装python ldap时遇到以下错误。注意,我已经在我的系统上设置了OpenLDAP、berkely db。我遵循的步骤是:

tar xvf python-ldap-2.4.10.tar.gz\
cd python-ldap-2.4.10\
#edit setup.cfg\
#library_dirs = /nlu/users/prefix /usr/lib\
#include_dirs = /nlu/users/prefix /usr/include/sasl /usr/include\
python setup.py install\
我得到以下错误

python setup.py install
defines: HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
extra_compile_args:
extra_objects:
include_dirs: /nlu/users/prefix/include /usr/include/sasl /usr/include
library_dirs: /nlu/users/prefix/lib /usr/lib
libs: ldap_r
running install
running bdist_egg
running egg_info
writing requirements to Lib/python_ldap.egg-info/requires.txt
writing Lib/python_ldap.egg-info/PKG-INFO
writing top-level names to Lib/python_ldap.egg-info/top_level.txt
writing dependency_links to Lib/python_ldap.egg-info/dependency_links.txt
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
reading manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules/LICENSE'
writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
file Lib/ldap.py (for module ldap) not found
file Lib/ldap/controls.py (for module ldap.controls) not found
file Lib/ldap/extop.py (for module ldap.extop) not found
file Lib/ldap/schema.py (for module ldap.schema) not found
running build_ext
building '_ldap' extension
gcc -pthread -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -     I/nlu/users/indrani_gorti/prefix/include -fPIC -I/nlu/users/indrani_gorti/prefix/include -     fPIC -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -     DLDAPMODULE_VERSION=2.4.13 -IModules -I/nlu/users/prefix/include -  I/usr/include/sasl -I/usr/include -I/nlu/users/prefix/include/python2.7 -c       Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o
Modules/LDAPObject.c:18:18: error: sasl.h: No such file or directory
Modules/LDAPObject.c:553: error: expected declaration specifiers or '...' before     'sasl_interact_t'
Modules/LDAPObject.c: In function 'interaction':
Modules/LDAPObject.c:562: error: 'interact' undeclared (first use in this function)
Modules/LDAPObject.c:562: error: (Each undeclared identifier is reported only once
Modules/LDAPObject.c:562: error: for each function it appears in.)
Modules/LDAPObject.c: In function 'py_ldap_sasl_interaction':
Modules/LDAPObject.c:607: error: 'sasl_interact_t' undeclared (first use in this    function)
Modules/LDAPObject.c:607: error: 'interact' undeclared (first use in this function)
Modules/LDAPObject.c:607: error: expected expression before ')' token
Modules/LDAPObject.c:610: error: 'SASL_CB_LIST_END' undeclared (first use in this  function)
Modules/LDAPObject.c:612: error: too many arguments to function 'interaction'
error: command 'gcc' failed with exit status 1

使用python包索引
pip
安装ldap可能是个好主意。简单键入:

pip install python-ldap
在命令提示下。或者,如果您需要管理员权限

sudo pip install python-ldap

我已经试过了。我没有行政特权。我正在尝试从源代码安装到/nlu/users/prefix中的前缀目录中。我已经对setup.cnf文件进行了更改(如上所示)。我已成功打开ldap设置。