[python-win32] Problems with XML COM server

Stephen Dicks stephen.dicks at rawflow.com
Wed Jul 6 11:51:39 CEST 2005

   I have a simple COM server in python which parses an XML file via 
SAX, and I want to distribute it via py2exe as the target machines will 
not have python installed (and in some cases could not have it installed)

However I have tried several (recent) versions of py2exe, python itself 
and the various fixes suggested by various people in the past, but I 
still can't get it to work in any configuration using either python 
2.3.5/2.4.1 or py2exe 0.4.2/0.5.4 with Windows XP

Using python 2.3 and py2exe 0.4.2, a standalone EXE builds and works 
fine, but the COM server fails the --register command line with 'Cannot 
locate Python module win32com.server.localserver' while executing 

Using python 2.4 and py2exe 0.5.4, the standalone executable fails with:

Traceback (most recent call last):
   File "fred.py", line 39, in ?
   File "xml\sax\drivers\drv_pyexpat.pyc", line 68, in parseFile
   File "xml\sax\drivers\drv_pyexpat.pyc", line 45, in startElement
 AttributeError: "module" object has no attribute "AttributeMap"

which no-one else seems to have had trouble with.

Using python 2.3 and py2exe 0.5.4, the py2exe setup stage fails with errors like:

'Cant find module linecache' 
'Cant find module xml'

and the parse stops with 'Cannot find parser' (not surprisingly) if I try to run the resulting executable.

Does anyone know of a combination that works?

More information about the Python-win32 mailing list