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

Thomas Heller thomas.heller at ion-tof.com
Wed Sep 26 15:01:03 EDT 2001


"Radhika Bodapatla" <rbodapatla at hotmail.com> wrote in message news:a1d2cfb3.0109261009.183099fc at posting.google.com...
> My application[eclient.py, on winNT4.0] uses
> win32com.client[win32com.client.Dispatch('MSXML2.XMLHTTP'),
> win32com.client.dynamic.Dispatch("Excel.Application")]  and also
> xml.sax for xml parsing.
> I create a setup.py file:
> ;-----setup.py-----------
> from distutils.core import setup
> import py2exe
> setup(name="eclient",
>       scripts=["eclient.py"],
>       data_files=[("template",["expenseform.xls"])],)
> ;------------------------
> I run it using py2exe:
> python setup.py 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
> _GetGoodDispatchandUserName
>   File "win32com\client\dynamic.pyc, line 72, in _GetGoodDispatch
> pywintypes.com_error: (-2147221005, 'Invalid class string', None,
> None)
win32com\client\dynamic, line 72 is
   IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)

I could be wrong, but doesn't this error say that CoCreateInstance fails
because the COM object you are trying to use is not registered on the other machine?

Thomas





More information about the Python-list mailing list