py2exe: LookupError: no codec search function registered

Thomas Guettler zopestoller at thomas-guettler.de
Tue Mar 25 10:04:52 EST 2003


Thomas Guettler schrieb:
> Hi!
> 
> My script works fine, but if I use the exe created
> by py2exe, I get:
> 
> LookupError: no codec search functions registered: can't find encoding
> 
> The code:
>   unicode(bulg, "windows-1251").encode("utf-8")

found the answer myself:

"""
Recent Python versions contain support for unicode, which requires the 
encodings package to be included in the exe-file. This is not included 
by default, and it would be very difficult for py2exe to find that this 
is needed.
So if your exe-file reports errors like LookupError: no codec search 
functions registered: can't find encoding or LookupError: unknown 
encoding, you should advise py2exe to include this package with the 
'--packages encodings' command line option.
"""
http://starship.python.net/crew/theller/py2exe/

  thomas





More information about the Python-list mailing list