[python-win32] Building pywin32 & adsi support

Tim Golden mail at timgolden.me.uk
Tue Jan 21 11:23:35 CET 2014


I'm trying to bring my active_directory module up to scratch with Python
3. I'm hitting a couple of effective showstoppers.

First: I can't even build pywin32 for any revision past 337015e6d473,
which is when the IConverterSession stuff went in. I've tried a couple
of tweaks, but basically:

"""
com/win32comext/mapi/src/mapi.cpp(645) : fatal error C1083: Cannot open
include file: 'IConverterSession.h': No such file or directory
error: command '"c:\Program Files (x86)\Microsoft Visual Studio
9.0\VC\BIN\cl.exe"' failed with exit status 2
"""

I've got a full VS 2010 Professional install, but for the life of me I
can't track down that file. It appears to be part of an Outlook API but
there doesn't seem to be anything I should be downloading additionally
from MSDN. Please feel free to point me in an "I should have seen that"
direction!


Second: the adsi module won't import even in a released pywin32 218
install on any version of Python 3.x I have installed. It seems to have
fallen foul of Python 3's more restricted relative import semantics.
This is Python 3.3 but the same happens for 3.2 & 3.1 and for several
different incantations of the import (from win32com etc.)

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


A simple fix from 2.7 onwards is to use package-relative imports:

"from .adsi import *"

but this won't fly with earlier versions. I haven't tried 2.6 but 2.4
certainly won't buy it. I'm aware that the win32com extensions do some
fancy footwork with imports for some reason which may or not be
necessary any longer, but I don't believe that that's the culprit in
this case.

Not quite sure where to go with these. I'll experiment a bit to see if I
can produce an adsi module/package/import structure which is acceptable
to all supported versions, but if anyone's got any bright ideas I'd be
happy to hear them!

TJG


More information about the python-win32 mailing list