Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 708
user1768233 Avatar asked Apr 23 '18 00:04

user1768233


1 Answers

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.

like image 85
4 revs Avatar answered Oct 12 '22 20:10

4 revs