Hello,
I have been working on a Windows 10 O.S using Python 3.4.4, I installed pywin32-220 using win64 installer "pywin32-220.win-amd64-py3.4.exe"), also I have installed py2exe 0.9.22 (that covers Python 3.4, using "py2exe-0.9.2.2.win-amd64.exe" installer). My goal is to obtain a python compiled object running on windows 64-bit O.S.as 64-bit COM object.
SO in py2exe parameters I include "win32com" in "includes" list (used in py2exe). Building my test project I got the following error :
....
File "C:\Python34\Lib\site-packages\py2exe\mf3.py", line 274, in _gcd_import
return self._find_and_load(name)
File "C:\Python34\Lib\site-packages\py2exe\mf3.py", line 339, in _find_and_load
raise ImportError(name)
ImportError: pywintypes
Going to debug, the error has raised in find_loader function (contained in "C:\Python34\Lib\importlib_ini.py") at line 68, because the statement executed
loader = sys.modules[name].loader
and loader value is None
meanwhile sys.modules[name] has value
module: <module 'pywintypes'="" from="" 'C:\\WINDOWS\\SYSTEM32\\pywintypes34.dll'="">
So the dll is effectifevely placed in System32 from installer package...
I can't understand what is wrong, but this seems a regression because in python 2.7 it works fine.
I would to thank you in advance for the help on this issue.
Regards
Fabio
python 3, py2exe and pywin32 is a highly expiermental configuration - the py2exe changes in particular are very new. This sounds like a build-time error where py2exe doesn't handle the pywin32 import tricks - I suggest you tweak py2exe to ignore/skip the error finding core py2win32 dlls and continue.