py2exe and SOAP.py

Gregory P. Smith greg at electricrain.com
Mon Aug 27 23:55:25 EDT 2001


On Thu, Aug 23, 2001 at 11:56:13AM -0500, Scott Hathaway wrote:
> I am trying to build an .exe with py2exe on Windows with a project that uses
> SOAP.py.  When I try to run the .exe I get this error:
> 
> LookUp Error:  no codec search functions registered:  can't find encoding
> 
> Any ideas on how to fix this?

Yes, this one was annoying.  I make sure I do this somewhere in my
code have the needed dependencies show up to py2exe:

...........
# don't use this file in actual code, its sole purpose is to import
# everything necessary to grab from PyXML so that Gordon's Installer
# will package up a python program that uses PyXML properly.

# include PyXML
import xml
from xml import dom, marshal, parsers, sax, utils #,unicode
import xml.dom.minidom
import xml.parsers.xmlproc
import xml.parsers.xmlproc.xmlproc
import xml.parsers.pyexpat
from xml.sax import drivers, drivers2
from xml.sax.drivers import drv_pyexpat, drv_xmlproc
from xml.sax.drivers2 import drv_pyexpat, drv_xmlproc

import xml.unicode
from xml.unicode import iso8859, utf8_iso
...........

I believe it was the latter two lines that had to be added to work around
the missing codec problem.

I also renamed the PyXML installation's '_xmlplus' directory to 'xml'
(replacing the tiny 'xml' directory that comes with python) so that the
PyXML modules are packaged correctly for me.

-Greg

-- 
Gregory P. Smith   gnupg/pgp: http://electricrain.com/greg/keys/
                   C379 1F92 3703 52C9 87C4  BE58 6CDA DB87 105D 9163




More information about the Python-list mailing list