0

I'm trying to import the active_directory module to my python code, but having a problem where it's telling me there is no module called adsi.

>>> import active_directory
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python33\lib\site-packages\active_directory.py", line 105, in <module
>
    from win32com import adsi
  File "C:\Python33\lib\site-packages\win32comext\adsi\__init__.py", line 25, in
 <module>
    from adsi import *
ImportError: No module named 'adsi'

I have the latest pywin32 (219) installed, but still getting this error. Does anybody know why this is?

Thanks a bunch!!

ryansin
  • 1,735
  • 2
  • 26
  • 49

1 Answers1

1

Managed to sort this by changing:

from adsi import *

in C:\Python33\lib\site-packages\win32comext\adsi__init__py to

from .adsi import *

I'm now able to import active_directory just fine.

ryansin
  • 1,735
  • 2
  • 26
  • 49
  • 1
    This looks like it is now committed to the pywin32 repo - https://github.com/mhammond/pywin32/commit/77f2a52cf5792cc3b11a17386aee4f2176b06640 (as of 25th April 2020) – bard Apr 29 '20 at 20:35
  • @bard thanks, that's nice to know. I wrote this many moons ago before I knew anything about contributing to projects but glad to see it's going to be resolved for everybody going forwards. – ryansin Apr 30 '20 at 16:02