tkFileDialog causing errors with packp3d

I’m trying to make a p3d file for my Panda-based game development kit, but it uses tkFileDialog. Packing it with packp3d produces this error at runtime:

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 "/home/alexander/NetBeansProjects/OpenBlox Game Engine/src/oblaunch.py", line 22, in <module>
    import obengine.phys
  File "VFSImporter", line 153, in load_module
  File "/home/alexander/NetBeansProjects/OpenBlox Game Engine/src/obengine/phys/__init__.py", line 24, in <module>
    import obengine.gfx
  File "VFSImporter", line 153, in load_module
  File "/home/alexander/NetBeansProjects/OpenBlox Game Engine/src/obengine/gfx/__init__.py", line 24, in <module>
    import obengine.cfg
  File "VFSImporter", line 153, in load_module
  File "/home/alexander/NetBeansProjects/OpenBlox Game Engine/src/obengine/cfg.py", line 29, in <module>
    import tkMessageBox
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.6/lib-tk/tkMessageBox.py", line 25, in <module>
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.6/lib-tk/tkCommonDialog.py", line 11, in <module>
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.6/lib-tk/Tkinter.py", line 39, in <module>
ImportError: No module named _tkinter
: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 "/home/alexander/NetBeansProjects/OpenBlox Game Engine/src/oblaunch.py", line 22, in <module>
    import obengine.phys
  File "VFSImporter", line 153, in load_module
  File "/home/alexander/NetBeansProjects/OpenBlox Game Engine/src/obengine/phys/__init__.py", line 24, in <module>
    import obengine.gfx
  File "VFSImporter", line 153, in load_module
  File "/home/alexander/NetBeansProjects/OpenBlox Game Engine/src/obengine/gfx/__init__.py", line 24, in <module>
    import obengine.cfg
  File "VFSImporter", line 153, in load_module
  File "/home/alexander/NetBeansProjects/OpenBlox Game Engine/src/obengine/cfg.py", line 29, in <module>
    import tkMessageBox
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.6/lib-tk/tkMessageBox.py", line 25, in <module>
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.6/lib-tk/tkCommonDialog.py", line 11, in <module>
  File "VFSImporter", line 153, in load_module
  File "/usr/local/lib/python2.6/lib-tk/Tkinter.py", line 39, in <module>
ImportError: No module named _tkinter
Successfully joined thread: 0
Failure on startup.

This is how I generate the p3d:

packp3d -o openbloxge.p3d -m oblaunch.py -r tk -r ode  -r morepy -d <project code directory>

Anyone know how to solve this?
As always, I’m using Panda3d 1.7.0 on Ubuntu 10.04 (Lucid) with Python 2.6.5.

Just an idea, but I think that the server hosting your p3d file needs to have the tkinter files located alongside your file. The files might need to be put in a specific place where your server has permissions to run Python scripts. Then again, I’m not really sure what the Panda plugin actually does, so I can’t say for sure.

EDIT: I accidentally assumed this happened at runtime. You can disregard what I said. Sorry.

I believe the problem is because _tkinter is really _tkinter.so (which is the Linux equivalent of .dll), so it’s not a pure Python library.

Perhaps finding a compiled Windows _tkinter.dll and manually placing it in my source directory, alongside _tkinter.so, will solve everything.

I’ll try it, and post back here.

Nah, that didn’t work.

Anyone have any ideas?