packing panda3d app with PyQt4

Hi!

I have problem with PyQt4 and Panda3d. I used packp3d and successfully created myapp.p3d, but when I tried to run this application I got following error:

:AppRunner: Total Panda3D disk space used: 179 MB
:AppRunner: Configured max usage is: 2048 MB
Traceback (most recent call last):
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/mnt/PYTHON/PYTHON/Wizualizacja/Aplikacja/Main.py", line 3, in <module>
    from PyQt4 import QtCore, QtGui
ImportError: No module named PyQt4
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 638, in run
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/task/Task.py", line 502, in run
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/task/Task.py", line 460, in step
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 424, in __taskChainDispatch
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/showbase/Messenger.py", line 482, in __dispatch
  File "/home/buildbot/slave/release_rtdist_linux_amd64/build/panda3d/built_cmu/direct/p3d/AppRunner.py", line 748, in __startIfReady
  File "VFSImporter", line 153, in load_module
  File "/mnt/PYTHON/PYTHON/Wizualizacja/Aplikacja/Main.py", line 3, in <module>
    from PyQt4 import QtCore, QtGui
ImportError: No module named PyQt4
Successfully joined thread: 0
Failure on startup.

Is there a way to fix this issue?

PyQt4 is not one of the thirdparty packages hosted at cmu.org. So, it means you will need to build your own Panda package that contains everything needed to support PyQt4, and host it on your own website. Then you can use the -r parameter to packp3d to “require” this package into your p3d file.

This is not a trivial matter, but it’s not really all that difficult either. You will need to read up on creating and hosting Panda3D packages in the manual.

David