2011-09-19 140 views
2

我想在cygwin下安装基本的ldap python模块。以下是失败的:在cygwin下安装python ldap模块

%easy_install ldap 
Searching for ldap... 
.. 
No local packages or download links found for ldap 

我使用CherryPy的为这是在Ubuntu上运行的精细的应用程序,并计划将它移植Cygwin的,所以我可以在我的Win7 lapop运行应用程序。

(我可以安装一个Django专用模块的Django认证 - LDAP,并试图导入如LDAP,但是这似乎并不具有基本的LDAP模块的初始化方法。)

PS :我忘了提试图蟒蛇,LDAP,但“easy_install的蟒蛇,LDAP”由于某种编译错误:

..... 
..... 
Modules/constants.c: In function `LDAPinit_constants': 
Modules/constants.c:153:1: error: `LDAP_OPT_DIAGNOSTIC_MESSAGE' undeclared (first use in this function) 
Modules/constants.c:153:1: note: each undeclared identifier is reported only once for each function it appears in 
Modules/constants.c:363:29: error: `LDAP_CONTROL_RELAX' undeclared (first use in this function) 
error: Setup script exited with error: command 'gcc' failed with exit status 1 
+0

django-auth-ldap依赖于python-ldap;它不会取代它。 – psagers

回答

9

另一个计算器页面来营救:python-ldap OS X 10.6 and Python 2.6

最终的解决方案:

pip install python-ldap==2.3.13 

这里注意到它,在Cygwin的这个人面对可以用这个职位。

+0

确实'pip'通常是答案 – SingleNegationElimination

+2

我对pip与easy_install之间的区别并不熟悉,但是在编辑过程中他们都失败了。我认为python-ldap(2.3.13)的特定版本是真正的求解器。 –

0

你确定这不是easy_install python-ldap你想要什么?

Django LDAP授权中间件是中间件 - 也就是说它不能像Python模块一样使用。它旨在包装WSGI应用程序。

查看Django Middleware documentation了解更多信息。

+0

我忘记提及尝试安装python-ldap,但也失败了:Modules/constants.c:在函数LDAPinit_constants中: Modules/constants.c:153:1:error:'LDAP_OPT_DIAGNOSTIC_MESSAGE'undeclared(firs 在这个函数中使用) Modules/constants.c:153:1:注意:每个未声明的标识符只会报告出现在 e中,因为它出现在 Modules/constants.c:363:29:error:'LDAP_CONTROL_RELAX'未声明(首次在 中使用此功能) 错误:安装脚本退出时显示错误:命令'gcc'失败,退出状态为1 –