簡體   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