首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装python-ldap时出错

安装python-ldap时出错
EN

Stack Overflow用户
提问于 2013-08-01 14:24:03
回答 1查看 1.9K关注 0票数 2

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

代码语言:javascript
复制
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\

我得到以下错误。

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-08-01 21:04:40

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

代码语言:javascript
复制
pip install python-ldap

在命令提示符下。或者,如果你需要管理特权,

代码语言:javascript
复制
sudo pip install python-ldap
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17996753

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档