Differences between revisions 1 and 13 (spanning 12 versions)
Revision 1 as of 2003-11-26 18:11:10
Size: 150
Editor: 193
Comment:
Revision 13 as of 2004-04-15 15:50:05
Size: 1155
Editor: yi154
Comment: added --packages solution and symptoms of missing codecs
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
In py2exe 0.5, if the encodings are not found in the built exe, add these two to the ''includes'':
{{{'encodings', 'encodings.*'}}}
== Solution 1 ==

In py2exe 0.5, if the encodings are not found in the built exe (indicated by {{{LookupError: no codec search functions registered}}} error message), 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.

That replaces the {{{'--force-imports encodings'}}} command line option from the [http://starship.python.net/crew/theller/py2exe/ 0.4py2exe]


== Solution 2 ==

Adding {{{'encodings', 'encodings.*'}}} to includes includes ALL encodings. I'm perfectly happy with only having latin-1 present (at least for some application, which will only be used in western europe)

so recommended adding {{{
'encodings', 'encodings.latin_1'
}}}

20041201HAM

== Sample ==
To avoid misunderstandings here is a sample setup.py
{{{
from distutils.core import setup
import py2exe
      
setup(console=["MyScript.py"],
      options = {"py2exe": {"packages": ["encodings"]}},
)
}}}
(which by the way is roughly the same as {{{setup.py py2exe --packages encodings}}}.)

Encoding

Solution 1

In py2exe 0.5, if the encodings are not found in the built exe (indicated by LookupError: no codec search functions registered error message), 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.

That replaces the '--force-imports encodings' command line option from the [http://starship.python.net/crew/theller/py2exe/ 0.4py2exe]

Solution 2

Adding 'encodings', 'encodings.*' to includes includes ALL encodings. I'm perfectly happy with only having latin-1 present (at least for some application, which will only be used in western europe)

so recommended adding

'encodings', 'encodings.latin_1'

20041201HAM

Sample

To avoid misunderstandings here is a sample setup.py

from distutils.core import setup
import py2exe
      
setup(console=["MyScript.py"],
      options = {"py2exe": {"packages": ["encodings"]}},
)

(which by the way is roughly the same as setup.py py2exe --packages encodings.)

EncodingsAgain (last edited 2008-07-08 11:27:44 by localhost)