We've created a Windows app with an embedded Python interpreter
(2.6.1).  The deployment includes the files for pywin32 on both x86
Release and Debug builds.  Since pywin32 isn't formally installed, I
found it necessary to manually import a couple modules at startup
before others would import correctly.  Specifically the code I have to
do that:

<code>
import imp, sys

for suffixes in imp.get_suffixes():
   if (suffixes[0] == '_d.pyd'):
      dllSuffix = '_d' # it's Debug
      break
   else:
      dllSuffix = ''   # it's Release
        
manualImportModules = ['pywintypes', 'pythoncom']

for modName in manualImportModules:
   modulePath =
r'D:\projects\tool\Python\packages\pywin32_system32\%s%d%d%s.dll' %
(modName, sys.version_info[0], sys.version_info[1], dllSuffix)
   imp.load_module(modName, None, modulePath, ('.dll', 'rb', imp.C_EXTENSION))
</code>

I took the meat of that from pywin32_postinstall.py, and it works
great in Release builds.  However, in Debug build I get the following
error on pywintypes:

   imp.load_module(modName, None, modulePath, ('.dll', 'rb', imp.C_EXTENSION))
   ImportError: DLL load failed: The application has failed to start
because its side-by-side configuration is incorrect. Please see the
application event log for more detail.

If it's relevant, the Python DLLs and pywin32 files were built with
VS2008 on both configurations.

I've searched around for this with no luck.  Any suggestions?

- Adam
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to