wxPython & py2exe

Hi,

I tried to compile a wxPython program using py2exe. The compilation works well, but when I run the program it stops immediately and returns me this error:

Traceback (most recent call last):
   File "main.py", line 1, in ?
   File "wx\__init__.pyc", line 42, in ?
   File "wx\_core.pyc", line 11457, in ?
   File "wx\_gdi.pyc", line 2511, in ?
   File "wx\_gdi.pyc", line 2346, in AddCatalogLookupPathPrefix
LookupError: unknown encoding: cp1252

Someone knows why and how can I solve the problem?
I tried compilation using both unicode and ascci version of wxpython, whith the same result.

bye

I ran into the same problem, what I ended up doing was modifying the site.py file in Python24\lib, lines 395 and 396. Comment them out, then Python won't delete setdefaultencoding() from sys. Then in my main python file I added the following: ( in my case dependant upon which language you log in as )

if guiLanguage == 'J':
        sys.setdefaultencoding('utf-8')
    else:
        sys.setdefaultencoding('ISO-8859-1')

that did it for me, I can launch my application in English, German, Italian, Spanish, French and Japanese with no problems, and I have no compile issues with py2exe.

···

From: Gabriele Farina *DarkBard* <darkbard@extending-php.net>
Reply-To: wxPython-users@lists.wxwidgets.org
To: wxPython <wxPython-users@lists.wxwidgets.org>
Subject: [wxPython-users] wxPython & py2exe
Date: Mon, 04 Apr 2005 12:52:59 +0200

Hi,

I tried to compile a wxPython program using py2exe. The compilation works well, but when I run the program it stops immediately and returns me this error:

Traceback (most recent call last):
  File "main.py", line 1, in ?
  File "wx\__init__.pyc", line 42, in ?
  File "wx\_core.pyc", line 11457, in ?
  File "wx\_gdi.pyc", line 2511, in ?
  File "wx\_gdi.pyc", line 2346, in AddCatalogLookupPathPrefix
LookupError: unknown encoding: cp1252

Someone knows why and how can I solve the problem?
I tried compilation using both unicode and ascci version of wxpython, whith the same result.

bye

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org

this is not a wxpython problem but a py2exe one :wink:
try adding "-p encodings" like in:

python setup.py py2exe -p encodings

···

On Mon, 04 Apr 2005 13:52:59 +0300, Gabriele Farina *DarkBard* <darkbard@extending-php.net> wrote:

Hi,

I tried to compile a wxPython program using py2exe. The compilation works well, but when I run the program it stops immediately and returns me this error:

Traceback (most recent call last):
   File "main.py", line 1, in ?
   File "wx\__init__.pyc", line 42, in ?
   File "wx\_core.pyc", line 11457, in ?
   File "wx\_gdi.pyc", line 2511, in ?
   File "wx\_gdi.pyc", line 2346, in AddCatalogLookupPathPrefix
LookupError: unknown encoding: cp1252

Someone knows why and how can I solve the problem?
I tried compilation using both unicode and ascci version of wxpython, whith the same result.

--
Peter Damoc
Warrior Of The Light

Gabriele Farina *DarkBard* wrote:

Hi,

I tried to compile a wxPython program using py2exe. The compilation works well, but when I run the program it stops immediately and returns me this error:

Traceback (most recent call last):
  File "main.py", line 1, in ?
  File "wx\__init__.pyc", line 42, in ?
  File "wx\_core.pyc", line 11457, in ?
  File "wx\_gdi.pyc", line 2511, in ?
  File "wx\_gdi.pyc", line 2346, in AddCatalogLookupPathPrefix
LookupError: unknown encoding: cp1252

Someone knows why and how can I solve the problem?
I tried compilation using both unicode and ascci version of wxpython, whith the same result.

bye

I had the same problem when I switch from wx 2.5.3 to 2.5.4, with the
same code, but I don't know why.
I resolve this, like other users say you, with this two pages:

python default encoding :

py2exe encodings problems:
http://starship.python.net/crew/theller/moin.cgi/EncodingsAgain

Michele