Packaging problem[py2exe, Inno setup] - pywintypes.com_error

Radhika Bodapatla rbodapatla at
Wed Sep 26 20:09:54 CEST 2001

My application[, on winNT4.0] uses
win32com.client.dynamic.Dispatch("Excel.Application")]  and also
xml.sax for xml parsing.
I create a file:
from distutils.core import setup
import py2exe
I run it using py2exe:
python py2exe -p _xmlplus,win32com
This creates 2folders build and dist. In the dist folder it creates
eclient folder in which it has the eclient.exe and other .dlls. Also
creates a folder tcl with 2more folders in it- tcl8.3 and tk8.3.
Then I use Inno setup[I only include the files in the dist folder] to
create my .exe so that I can install it on a machine that doesn't have
python installed on it.
But this is the error I get when I try to run it from another machine:
Traceback <most recent call last>:
  File "<string>", line 332, in ?
  File "<string>", line 12, in __init__
  File "win32com\client\__init__.pyc, line 94, in Dispatch
  File "win32com\client\dynamic.pyc, line 81, in
  File "win32com\client\dynamic.pyc, line 72, in _GetGoodDispatch
pywintypes.com_error: (-2147221005, 'Invalid class string', None,

I tried using the --force-imports win32com option but with no luck.
It runs fine on my machine[ofcourse, I have python installed] I tried
changing the path & pythonpath and also renamed the win32com folder on
my machine and the .exe still runs fine on my machine.
Any help or tips appreciated.
Thank you.

More information about the Python-list mailing list