2011-06-29 55 views
-2

所以我從源代碼中獲得了最新的python-ldap。我也運行python 2.7.2的源代碼編譯版本,我在RHEL上運行它。所以當我嘗試編譯這個包時,我會看到如下所示的這個很長的錯誤信息。所以我安裝了openldap-devel軟件包,現在它是一個更小的錯誤。但還沒有編譯。Python-LDAP無法編譯

extra_compile_args: -g 
extra_objects: 
include_dirs: /opt/openldap-RE24/include /usr/include/sasl 
library_dirs: /opt/openldap-RE24/lib 
libs: ldap_r lber sasl2 ssl crypto 
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 -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/LDAPObject.c -o build/temp.linux-x86_64-2.7/Modules/LDAPObject.o -g 
In file included from Modules/LDAPObject.c:18: 
/usr/include/sasl/sasl.h:349: warning: function declaration isnât a prototype 
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/ldapcontrol.c -o build/temp.linux-x86_64-2.7/Modules/ldapcontrol.o -g 
Modules/ldapcontrol.c: In function âencode_assertion_controlâ: 
Modules/ldapcontrol.c:350: warning: implicit declaration of function âldap_create_assertion_control_valueâ 
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/common.c -o build/temp.linux-x86_64-2.7/Modules/common.o -g 
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DHAVE_LIBLDAP_R -DHAVE_SASL -DHAVE_TLS -DLDAPMODULE_VERSION=2.4.1 -IModules -I/opt/openldap-RE24/include -I/usr/include/sasl -I/opt/home/mradmin/.local/include/python2.7 -c Modules/constants.c -o build/temp.linux-x86_64-2.7/Modules/constants.o -g 
Modules/constants.c: In function âLDAPinit_constantsâ: 
Modules/constants.c:153: error: âLDAP_OPT_DIAGNOSTIC_MESSAGEâ undeclared (first use in this function) 
Modules/constants.c:153: error: (Each undeclared identifier is reported only once 
Modules/constants.c:153: error: for each function it appears in.) 
Modules/constants.c:363: error: âLDAP_CONTROL_RELAXâ undeclared (first use in this function) 
error: command 'gcc' failed with exit status 1 

由於這是封閉的,因爲這個問題,沒有ocmpile請幫我出來不是一個問題。我想到了。我不得不手動編譯最新的ldap,berkleydb,然後使用它進行構建安裝。然後它建立好了

+2

這是很多文字。那裏有什麼問題嗎? –

+0

@George Cummins是的,如何在Python上編譯LDAP。 – phihag

+1

@Nerdtastic對於代碼和代碼輸出,您應該使用代碼格式(Ctrl + K),而不是引號。引用插入並破壞行結束。此外,您可以在第一個錯誤後剪切所有內容。 – phihag

回答

2

第一個和第二個錯誤消息指出你缺少lber.hldap.h。這是指向丟失或無效的openldap-devel軟件包的強有力指針。你有沒有安裝該軟件包(或類似的軟件包)(*ldap-dev*)?

+0

是的,我現在安裝了ldap-devel軟件包,它發生了一個小得多的錯誤。我將用新代碼更新主代碼 –

0

可能是OpenLDAP和python-ldap版本不匹配。嘗試針對體面版本的OpenSSL編譯最新的python-ldap版本。例如。 Debian系統已經臭名昭着舊版本的OpenLDAP安裝...

+0

您是否有推薦的版本?安裝的是2.3.43-12.el5_6.7 –