简体   繁体   English

python-ldap OS X 10.6和Python 2.6

[英]python-ldap OS X 10.6 and Python 2.6

Trying to install python-ldap for my Django project -- so far tried easy_install, pip, as well as building myself, but still getting the same errors: 试图为我的Django项目安装python-ldap - 到目前为止尝试了easy_install,pip,以及构建自己,但仍然得到相同的错误:

dlopen(/Library/Python/2.6/site-packages/_ldap.so, 2): Symbol not found: _ldap_create_assertion_control_value
Referenced from: /Library/Python/2.6/site-packages/_ldap.so
Expected in: flat namespace
in /Library/Python/2.6/site-packages/_ldap.so

What's going on? 这是怎么回事?

pip install python -ldap == 2.3.13为我做了伎俩(Mac OS X 10.6)

The problem and solution are documented here . 问题和解决方案都记录在这里

Summary: The 10.7.{0,1} system tools and headers are all from OpenLDAP 2.4.x while the libraries are from OpenLDAP 2.2.0. 简介:10.7。{0,1}系统工具和头文件均来自OpenLDAP 2.4.x,而库来自OpenLDAP 2.2.0。 The solution is to build the OpenLDAP libs to match the system headers and link python-ldap with those. 解决方案是构建OpenLDAP库以匹配系统头并将python-ldap与这些头链接起来。

All credit goes to Rob McBroom . 所有功劳都归功于Rob McBroom

I encountered the same error under 10.7 (Lion) using easy_install and pip . 我使用easy_installpip在10.7(Lion)下遇到了同样的错误。 Manually installing 2.3.13 was the answer there as well. 手动安装2.3.13也是答案。

I had to modify setup.cfg to get this to work on OS X. Here's what I did: 我不得不修改setup.cfg以使其在OS X上运行。这就是我所做的:

wget http://python-ldap.cvs.sourceforge.net/viewvc/python-ldap/?view=tar --output-document=python-ldap.tar.gz
tar xvf python-ldap.tar.gz
cd python-ldap

Modify the following lines in setup.cfg: 修改setup.cfg中的以下行:

library_dirs = /usr/local/lib
include_dirs = /usr/local/include /usr/include/sasl
libs = ldap lber sasl2 ssl crypto

Then continue with "normal" installation: 然后继续“正常”安装:

python setup.py build
sudo python setup.py install

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

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