2

I am having an issue with a program, which uses panda3d. It works perfectly when executed as a pythonscript, but the version, which is compiled (or rather packaged) by PyInstaller throws the exception below.

:display(warning): Unable to load libpandagl.so: No error.
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
  File "Shipsim3d_1-1.py", line 930, in <module>
  File "Shipsim3d_1-1.py", line 23, in __init__
  File "direct/showbase/ShowBase.py", line 339, in __init__
  File "direct/showbase/ShowBase.py", line 1024, in openDefaultWindow
  File "direct/showbase/ShowBase.py", line 1059, in openMainWindow
  File "direct/showbase/ShowBase.py", line 769, in openWindow
  File "direct/showbase/ShowBase.py", line 749, in <lambda>
  File "direct/showbase/ShowBase.py", line 821, in _doOpenWindow
  File "direct/showbase/ShowBase.py", line 650, in makeDefaultPipe
  File "direct/directnotify/Notifier.py", line 130, in error
Exception: No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.
[5466] Failed to execute script 'Shipsim3d_1-1' due to unhandled exception!

Usually, there is a Config.prc file in the etc subdirectory of the panda3d site-package directory. This file is non-existent in the packaged version. But if I create this subdirectory there, and copy the files to it as well, it still doesn't work and it still throws the same exception. There is a line "loadPrcData("win-size 1080 1920")" in my main program as well. Could this be part of the problem in any way? Or is there something else i am missing?

Thanks in advance

ductTapeIsMagic
  • 113
  • 1
  • 8

1 Answers1

0

I solved this problem by including the whole panda3d lib: pyinstaller --add-data="path/to/panda3d;panda3d" -wF main.py

HeLiang
  • 16
  • 1
  • Thank you very much, that worked perfectly. Just for anyone else who finds this, if you are using Linux, you need to replace the ; with a :, or you will get an Invalid-app-data-exception. – ductTapeIsMagic Feb 18 '23 at 09:44
  • Not only does this not work, but it makes the EXE massive. – Spiceinajar Jun 10 '23 at 21:16