How to get PyInstaller to work with Panda3D?

Hi,

I’m trying to use PyInstaller-3.0 to pack a python application that uses PyQt and Panda3D-1.9.1. I’m using 32bit python-2.7 on Windows 7 64bit.

When I run the generated executable I get the following error:

$ ./ServiceGUI.exe
Warning: unable to auto-locate config files in directory named by "<auto>etc".
Attempt to register type PythonCallbackObject more than once!
Attempt to register type PythonTask more than once!
:interrogatedb(warning): Classes panda3d.core.TypedObject and panda3d.core.TypedObject share the same TypeHandle value (3); check class definitions.
:interrogatedb(warning): Classes panda3d.core.ReferenceCount and panda3d.core.ReferenceCount share the same TypeHandle value (4); check class definitions.
:interrogatedb(warning): Classes panda3d.core.TypedReferenceCount and panda3d.core.TypedReferenceCount share the same TypeHandle value (5); check class definitions.
Traceback (most recent call last):
  File "<string>", line 15, in <module>
  File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 363, in load_module
    exec(bytecode, module.__dict__)
  File "c:\dev\daniels_projects\PycharmProjects\event_log_explorer\CustomerGUI.py", line 1, in <module>
    from direct.showbase.ShowBase import ShowBase
  File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 363, in load_module
    exec(bytecode, module.__dict__)
  File "C:\Panda3D-1.9.1\direct\showbase\ShowBase.py", line 28, in <module>
    from direct.interval import IntervalManager
  File "C:\Python27\Lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 363, in load_module
    exec(bytecode, module.__dict__)
  File "C:\Panda3D-1.9.1\direct\interval\IntervalManager.py", line 142, in <module>
    ivalMgr = IntervalManager(1)
  File "C:\Panda3D-1.9.1\direct\interval\IntervalManager.py", line 32, in __init__
    self.setEventQueue(self.eventQueue)
TypeError: CIntervalManager.set_event_queue() argument 1 must be panda3d.core.EventQueue, not panda3d.core.EventQueue
ServiceGUI returned -1

From the error message I can guess that panda3d is somehow loaded multiple times, but I have no idea how this happens and how to fix it.

Any ideas are appreciated! Thanks!

I have exactly the same problem. Did you (or anyone) already find a solution to this problem?

This looks like two copies of the Panda3D DLLs are somehow being loaded into the same process. Please check that there are not multiple copies of the DLLs present. Try uninstalling an existing SDK to see if that helps.

It may be that some of the Panda libraries are finding the Panda DLLs in a different place than others. In this case it might just be a matter of setting the PATH variable appropriately in some Python file before the DLLs are being loaded, or reorganising the directory structure.

Hi,
I just installed the latest version (v1.9.2) of Panda3D and I get the same error message when using cx_Freeze. Did you find how to solve the issue? I was using v1.8.1 without any problem.
Thanks,
Mikel

Try uninstalling the Panda3D SDK, and making sure there are no duplicate DLLs in the game directory. Why the DLLs are being loaded more than once, I’m not sure, but it may go away when placing the panda DLLs inside the same directory as core.pyd.

Thanks rdb! I will try that.

Hello,
I meet the same problem by using pyinstaller and py2exe. Btw I dont find any duplicate DLLs in the game directory.

from direct.showbase.ShowBase import ShowBase
I make sure this statement makes it happend, but i dont know how to solve it. Have any1 have an idea?

Thanks!