【发布时间】:2014-01-12 03:58:03
【问题描述】:
我需要安装 * Python-LDAP 在 Ptython 2.7 下运行
我有一个 Centos 5.8 系统(我无法升级到 6.x)。我目前安装了 Python 2.4 和 Python 2.7。我正在使用 Python 2.7 进行开发(连同 Django)。我安装了 Python-LDAP 并在 Python 2.4 下工作(它是使用 yum 安装的)。我需要安装 Python-LDAP 以用于 Python 2.7(我还将安装 Django-ldap)。我已经尝试了好几天来做到这一点。 yum 只能在 Python 2.4 下运行,所以我不能使用它。我从https://pypi.python.org/pypi/python-ldap/ 下载了 Python-LDAP 源代码(python-ldap-2.4.13.tar.gz (md5),但是当我尝试构建它时出现错误(见下文)。
有谁知道我是否/如何在 Centos 5 上安装 Python-LDAP for Python 2.7?
构建时出错:
python setup.py build
defines: HAVE_SASL HAVE_TLS HAVE_LIBLDAP_R
extra_compile_args:
extra_objects:
include_dirs: /home/sfuller/python-ldap-2.4.13 /usr/lib64/evolution-openldap/include
/usr/lib/evolution-openldap/include /usr/include/sasl /usr/include library_dirs: /home/sfuller/python-ldap-2.4.13 /usr/lib64/evolution-openldap/lib64 /usr/lib /进化-openldap/lib /usr/lib 库:ldap_r 运行构建 运行 build_py 找不到文件 Lib/ldap.py(用于模块 ldap) 找不到文件 Lib/ldap/controls.py(用于模块 ldap.controls) 找不到文件 Lib/ldap/extop.py(用于模块 ldap.extop) 找不到文件 Lib/ldap/schema.py(用于模块 ldap.schema) 找不到文件 Lib/ldap.py(用于模块 ldap) 找不到文件 Lib/ldap/controls.py(用于模块 ldap.controls) 找不到文件 Lib/ldap/extop.py(用于模块 ldap.extop) 找不到文件 Lib/ldap/schema.py(用于模块 ldap.schema) 运行 egg_info
....
warning: no files found matching 'Makefile'
warning: no files found matching 'Modules/LICENSE'
writing manifest file 'Lib/python_ldap.egg-info/SOURCES.txt'
running build_ext
building '_ldap' extension
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes
-fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.13 -IModules -I/home/sfuller/python-ldap-2.4.13 -I/usr/lib64/evolution-openldap/include -I/usr /lib/evolution-openldap/include -I/usr/include/sasl -I/usr/include -I/usr/local/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64 -2.7/模块/LDAPObject.o 在 Modules/LDAPObject.c:18:0 包含的文件中: /usr/include/sasl/sasl.h:349:5:警告:函数声明不是原型 [-Wstrict-prototypes]
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.13 -IModules -I/home/sfuller/python-ldap-2.4.13 -I/usr/lib64/evolution-openldap/include -I/usr/lib/evolution-openldap/include -I/usr/include/sasl -I/usr/include -I/usr/local/include/python2.7 -c Modules/ldapcontrol.c -o build/temp.linux-x86_64-2.7/Modules/ldapcontrol.o
Modules/ldapcontrol.c:在函数“encode_assertion_control”中: Modules/ldapcontrol.c:352:5:警告:函数“ldap_create_assertion_control_value”的隐式声明[-Wimplicit-function-declaration]
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.13 -IModules -I/home/sfuller/python-ldap-2.4.13 -I/usr/lib64/evolution-openldap/include -I/usr/lib/evolution-openldap/include -I/usr/include/sasl -I/usr/include -I/usr/local/include/python2.7 -c Modules/common.c -o build/temp.linux-x86_64-2.7/Modules/common.o
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_SASL -DHAVE_TLS -DHAVE_LIBLDAP_R -DHAVE_LIBLDAP_R -DLDAPMODULE_VERSION=2.4.13 -IModules -I/home/sfuller/python-ldap-2.4.13 -I/usr/lib64/evolution-openldap/include -I/usr/lib/evolution-openldap/include -I/usr/include/sasl -I/usr/include -I/usr/local/include/python2.7 -c Modules/constants.c -o build/temp.linux-x86_64-2.7/Modules/constants.o
Modules/constants.c: In function âLDAPinit_constantsâ:
Modules/constants.c:155:1: error: âLDAP_OPT_DIAGNOSTIC_MESSAGEâ undeclared (first use in
这个函数) Modules/constants.c:155:1:注意:每个未声明的标识符对于它出现的每个函数只报告一次 Modules/constants.c:365:29: error: âLDAP_CONTROL_RELAXâ undeclared (第一次在这个函数中使用) 错误:命令“gcc”失败,退出状态为 1
然后我查看了这个帖子:https://mail.python.org/pipermail/python-ldap/2011q2/002937.html
于是我下载了最新的 OpenLDAP 并得到:
./configure
Configuring OpenLDAP 2.4.38-Release ...
...
configure: error: BerkeleyDB version incompatible with BDB/HDB backends
好像我只是下沉到黑洞中......
【问题讨论】:
-
这可以回答我的问题..
标签: python django python-2.7 ldap centos5