BOMBOLOM.COM

(python) Codecs/Encodings problem with PY2EXE

Posted by José Lopes

While using PY2EXE you may come up with one the following error messages:

LookupError: unknown encoding:

Or:

LookupError: no codec search functions registered:
can't find encoding solution: explicitly include the encodings package:

These messages appear because Python loads all the necessary codecs/encodings when running, and its kind of normal that there will be libraries not loaded because they are not needed or they have partial imports.

Since py2exe doesn't do the same, it tries to include all libraries just in case they are necessary, we end up with more libraries than necessary and, here comes the problem, sometimes it doesn't find some of them resulting on the error messages mentioned.

To fix this we run the following command:

python setup.py py2exe -p encodings

With it we explicity say to py2exe not to include libraries by itself and only take into account the ones declared on the project files.

2007.05.21 | There's more... | Comments 0 | Tags , , ,

Deixe a sua mensagem:

Nome:


E-mail:


URL:


Comment:

Secret number

To send you comment you must insert the "secret number" on the box


Made with PyBlosxom | Add to Google