packp3d issue

Well, I just wanted to compile my first panda3d app and that’s what happens:

> ls
main.py*  pynk.py*  square.egg.pz  triangle.png
> packp3d -o app.p3d        
Traceback (most recent call last):
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 352, in __taskChainDispatch
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 410, in __dispatch
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/AppRunner.py", line 493, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/packp3d.py", line 219, in <module>
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/packp3d.py", line 209, in makePackedApp
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 2352, in endPackage
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 403, in close
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 493, in installMultifile
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showutil/FreezeTool.py", line 845, in done
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showutil/FreezeTool.py", line 919, in __loadModule
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showutil/FreezeTool.py", line 1358, in load_module
  File "/usr/local/lib/python2.6/modulefinder.py", line 305, in load_module
  File "/usr/local/lib/python2.6/modulefinder.py", line 414, in scan_code
  File "/usr/local/lib/python2.6/modulefinder.py", line 323, in _safe_import_hook
  File "/usr/local/lib/python2.6/modulefinder.py", line 126, in import_hook
  File "/usr/local/lib/python2.6/modulefinder.py", line 182, in find_head_package
  File "/usr/local/lib/python2.6/modulefinder.py", line 274, in import_module
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showutil/FreezeTool.py", line 1358, in load_module
  File "/usr/local/lib/python2.6/modulefinder.py", line 290, in load_module
LookupError: no codec search functions registered: can't find encoding
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/AppRunner.py", line 411, in run
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/task/Task.py", line 496, in run
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/task/Task.py", line 454, in step
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 352, in __taskChainDispatch
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showbase/Messenger.py", line 410, in __dispatch
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/AppRunner.py", line 493, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/packp3d.py", line 219, in <module>
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/packp3d.py", line 209, in makePackedApp
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 2352, in endPackage
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 403, in close
  File "/Users/rdb/pandaworker/panda3d-1.7.0/built_cmu/direct/p3d/Packager.py", line 493, in installMultifile
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showutil/FreezeTool.py", line 845, in done
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showutil/FreezeTool.py", line 919, in __loadModule
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showutil/FreezeTool.py", line 1358, in load_module
  File "/usr/local/lib/python2.6/modulefinder.py", line 305, in load_module
  File "/usr/local/lib/python2.6/modulefinder.py", line 414, in scan_code
  File "/usr/local/lib/python2.6/modulefinder.py", line 323, in _safe_import_hook
  File "/usr/local/lib/python2.6/modulefinder.py", line 126, in import_hook
  File "/usr/local/lib/python2.6/modulefinder.py", line 182, in find_head_package
  File "/usr/local/lib/python2.6/modulefinder.py", line 274, in import_module
  File "/root/pandaworker/panda3d-1.7.0/built_cmu/direct/showutil/FreezeTool.py", line 1358, in load_module
  File "/usr/local/lib/python2.6/modulefinder.py", line 290, in load_module
LookupError: no codec search functions registered: can't find encoding
Successfully joined thread: 0
Failure on startup.

deetah.jogger.pl/files/pynk-photos-300910.7z - here’s the sample code, main file is photos.py.

Hi, you used json (similer to pickle I think) annd also UTF encodings… so:
I had problems like this before (actually the exact error)

copy the whole “encodings” directory (C:\Python26\Lib\encodings) into your p3d directory and it will fix the problem. :wink:

Maybe it’s something that needs to be fixed, dunno tbh, all I know is that copying that directory into your folder with your app that you package will fix the error :smiley:

Could you try to use -r morepy? Does this solve?

Morepy doesn’t help, neither does copying the /usr/lib/python2.6/encodings either to the project directory nor to /usr/share/panda3d/direct/p3d. Still the same error.

If I launch photos.py I obtain:

Traceback (most recent call last):
  File "pynk.py", line 21, in <module>
    import mechanize
ImportError: No module named mechanize

Please, could you give us a simpler (as simple as possible) code which produces your error?

Ha! Found the victim!

 -*- coding: utf-8 -*-
print u'Hello łerld'

It contains an utf-8 polish lowercase letter L with a diacritic symbol. A temporary workaround is to remove the first line from the listing. Now I’ve just gotta read up on adding Python modules…