python - 属性错误 : 'module' object has no attribute 'SCOPE_SUBTREE' macOS

标签 python ldap

我正在尝试连接到我在本地计算机上运行的 ldap 服务器,但它抛出错误 AttributeError: 'module' object has no attribute 'SCOPE_SUBTREE'

到目前为止我做了什么:

使用 pip install python-ldap 安装 ldap 库

在我当前的工作目录中没有名为 ldap.py 的文件,因此没有重叠问题

当使用print dir(ldap) 命令时,会打印出以下内容

['HelpFormatter', 'PY3', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', 'argparse', 'logging', 'main', 'parser', 'subparser', 'subparsers', 'sys']

我正在研究 macOS Sierra。感谢任何帮助,python 版本为 2.7.10

最佳答案

您可能安装了 pip “ldap”而不是“python-ldap”

关于python - 属性错误 : 'module' object has no attribute 'SCOPE_SUBTREE' macOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46331583/

相关文章:

active-directory - Active Directory 中的 LDAP 过滤器字符串长度限制是多少?

python - 使用递归从 python 中的单体列表生成 k-mers

Python ldap3 创建组

active-directory - 如何查询自给定时间以来 LDAP (Active Directory) 删除的对象?

python - 如何在 scikit 中获取与卡方特征选择分数对应的特征名称

c - 如何在 C 语言的 LDAP 命令中使用变量?

从 openLDAP 客户端到 IBM LDAP 的 ssl 连接

python - Django 类型错误 : 'unicode' object is not callable

python - pandas - O() 对数据帧进行分组和求和的大 O 复杂性

python - 记录分组算法