[Tutor] Program work fine in IDLE but not once compile from Py2exe
Michel Bélanger
michel.belanger at seidel.ca
Fri Feb 20 08:58:39 EST 2004
>> I have the following function that works fine within IDLE but not the
>> exe version compile under Py2exe.
>
>> LookupError: no codec search functions registered: can't find encoding
>
>You need to tell py2exe to include the appropriate
>codec to convert between Unicode and 8-bit ASCII.
>For us that would be cp437, and for Sweden cp850,
>but I'm not sure about Canada, and I don't know the
>py2exe way of doing it from the top of my head.
This info lead me to the following in Py2exe site: http://starship.python.net/crew/theller/moin.cgi/EncodingsAgain
/*
"In py2exe 0.5, if the encodings are not found in the built exe, add these two to the /includes/:
'encodings', 'encodings.*'
You can do this by adding a line
options = {"py2exe": {"packages": ["encodings"]}},
to your setup.py file."
*/
Here is my setup.py
/*
# setup.py
from distutils.core import setup
import py2exe
setup(console=["XferUpdFileOnWeb.py"])
options = {"py2exe": {"packages": ["encodings"]}},
options = {"py2exe": {"packages": ["encodings.*"]}},
*/
Running Py2exe with options added to setup produced the error again about a missing codec.
Here is the last line copy from the dos prompt:
"LookupError: no codec search functions registered: can't find encoding"
Regards
Michel Belanger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20040220/06e7a4d8/attachment.html
More information about the Tutor
mailing list