0

I have installed ldap3 module for my python3. When I try to run import ldap3, I get such error. Can someone please advice me what to do?

python3                                                        
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ldap3

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.9/dist-packages/ldap3/__init__.py", line 255, in <module>
    from .core.connection import Connection
  File "/usr/local/lib/python3.9/dist-packages/ldap3/core/connection.py", line 53
    from ..strategy.async import AsyncStrategy
                    ^
SyntaxError: invalid syntax
>>> 
  • which version of ldap3 you are using? looks like some there is an issue with ldap3 and python3.7 and above. This link might help `https://github.com/cannatag/ldap3/issues/428` – Srinivas Aug 30 '21 at 18:45
  • I solved it by copying ldap3 from python3 to previous 2.7 version cp -r ldap3 /usr/lib/python2.7/dist-packages Now it works using just: python >>> import ldap3 – Suspense Sus Aug 30 '21 at 19:32

0 Answers0