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

Radhika Bodapatla rbodapatla at hotmail.com
Wed Sep 26 14:09:54 EDT 2001


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)
-----------------------------------------------

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.
Radhika.



More information about the Python-list mailing list