pythonpython-3.xldap3

Why can't I import LDAPBindError from LDAP3?


Hi I am trying to import 'LDAPBindError' from the ldap3 library and I am getting an import error. Can somebody please explain why this is not working?

from ldap3 import Server, Connection, ALL, LDAPBindError, SUBTREE, ALL_ATTRIBUTES,MODIFY_REPLACE

ImportError: cannot import name 'LDAPBindError'

I am using the following versions

pip3.6 list |grep ldap3 ldap3 (2.5)

python3.6 --version Python 3.6.4


Solution

  • All credit goes to Sraw, just adding the answer here because I originally missed it in the comments:

    from ldap3.core.exceptions import LDAPBindError
    

    The modules in ldap3 are organized into packages. I have not found specific documentation for this.