繁体   English   中英

在cygwin下安装python ldap模块

[英]Installing python ldap module under cygwin

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

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

我正在使用cherrypy用于在Ubuntu中正常运行的应用程序,并计划将其移植到cygwin,以便我可以在我的Win7 lapop下运行该应用程序。

(我可以安装一个特定于Django的模块django-auth-ldap,并尝试将其导入为ldap,但这似乎没有基本ldap模块具有的初始化方法。)

PS:我忘了提到尝试python-ldap,但'easy_install python-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

另一个stackoverflow页面来拯救: python-ldap OS X 10.6和Python 2.6

最终的解决方案:

pip install python-ldap==2.3.13

注意到这里所以在cygwin中遇到这种情况的人可以使用这篇文章。

你确定它不是easy_install python-ldap你想要的easy_install python-ldap吗?

Django LDAP授权中间件是中间件 - 也就是说它不能以与Python模块相同的方式使用。 它旨在包装WSGI应用程序。

有关更多信息,请参阅Django Middleware文档

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM