我需要安装 *Python LDAP 在Ptython 2.7下运行
我有一个Centos 5.8系统(我不能升级到6.x)。我目前已经安装了Python2.4和Python2.7。我使用python2.7进行开发(与Django一起使用)。我已经安装了pythonldap并在python2.4下工作(它是使用yum安装的)。我需要安装PythonLDAP以便与Python2.7一起使用(我还将安装DjangoLDAP)。我已经试了好几天了。yum只在python2.4下运行,所以我不能使用它。我下载了PythonLDAP源代码(Python-LDAP-2.4.13)。焦油gz(md5)来自https://pypi.python.org/pypi/python-ldap/,但当我尝试构建它时,我会遇到错误(见下文)。在
有人知道我是否/如何在Centos 5上安装PythonLDAP for Python2.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 库目录:/home/sfuller/python-ldap-2.4.13/usr/lib64/evolution openldap/lib64/usr/lib /进化openldap/lib/usr/lib libs:ldap\u r 正在运行生成 运行内部版本 文件库/ldap.py(对于模块ldap)未找到 文件库/ldap/控件.py(用于模块ldap.controls.控件)找不到 文件库/ldap/勒索(用于模块ldap.extop)找不到 文件库/ldap/架构.py(用于模块ldap.schema)找不到 文件库/ldap.py(对于模块ldap)未找到 文件库/ldap/控件.py(用于模块ldap.controls.控件)找不到 文件库/ldap/勒索(用于模块ldap.extop)找不到 文件库/ldap/架构.py(用于模块ldap.schema)找不到 运行鸡蛋信息
^{pr2}$-fPIC-DHAVE_SASL-DHAVE_TLS-DHAVE_LIBLDAP_R-DHAVE\ulibldap_R-DLDAPMODULE_版本=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模块/LDAPObject.c-o构建/临时linux-x86_64-2.7/Modules/LDAPObject.o 在Modules/LDAPObject.c:18:0中包含的文件中: /usr/include/sasl/sasl.h:349:5:警告:函数声明不是原型[-Wstrict prototype]
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:在函数“编码”断言“控制”中: 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–未声明(此函数中第一次使用) 错误:命令“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
好像我就要沉下去了。。。在
这在
centos 5.10
和python 2.7.6
中起作用。我安装到virtualenv
。在我在你的日志里看到关于
evolution-openldap
的内容,那是我遇到同样问题时的记录。这些目录由openldap 2.3x
安装。在您不需要从源代码构建
openldap
,因为yum中有一个新版本,足以满足python-ldap
的版本要求。在要安装,您应该先
yum install openldap24-libs openldap24-libs-devel
。在编辑设置.cfg因此它的
^{pr2}$[_ldap]
部分包含:再次运行生成。(我删除了我以前的构建/目录,如果上面的方法不起作用,您可能不需要尝试一下)。在
相关问题 更多 >
编程相关推荐