Exception: No graphics pipe is available! in Python compiled

Hi!
I installed panda3d in Centos 7, with python.
All works fine without compile the code, but when I use pyinstaller to compile the code I get the error:

1 explicit pages:
/home/fcruz/Documentos/00-Projects/07-atoms30/trunk/TOOLS/Panda3D/config/conf.prc

2 implicit pages:
/usr/lib64/python3.6/site-packages/panda3d/etc/Config.prc
/usr/lib64/python3.6/site-packages/panda3d/etc/Confauto.prc

:prc(warning): value queried before default value set for load-display.
ConfigVariableString-> pandagl
:prc(warning): changing default value for ConfigVariable load-display from ‘’ to ‘*’.
:display(warning): Unable to load libpandagl.so: No error.
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
File “01-window.py”, line 33, in
game = MyGame()
File “01-window.py”, line 17, in init
super().init()
File “site-packages/direct/showbase/ShowBase.py”, line 338, in init
File “site-packages/direct/showbase/ShowBase.py”, line 1020, in openDefaultWindow
File “site-packages/direct/showbase/ShowBase.py”, line 1055, in openMainWindow
File “site-packages/direct/showbase/ShowBase.py”, line 765, in openWindow
File “site-packages/direct/showbase/ShowBase.py”, line 751, in
File “site-packages/direct/showbase/ShowBase.py”, line 817, in _doOpenWindow
File “site-packages/direct/showbase/ShowBase.py”, line 647, in makeDefaultPipe
File “site-packages/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.

Can you help me?

Best regards,
Fernando

Hi, welcome to the forums!

How did you acquire Panda3D exactly? Did you compile it from source code yourself?

Hi! Thank for your quick attention.

I used python installed

What do you mean by that?

I use
pip install panda3d==1.10.7

Sorry, I did not read your original post properly. I did not realise you were using pyinstaller.

You need to include the etc/Config.prc and etc/Confauto.prc files in your compiled code directory, as well as the libpandagl.so file and any other plugins.

Is there a reason you are not using the distribution tool that ships with Panda3D? It does everything for you automatically.

Thanks for the help.

I would like to yse the distribution tool, but there aren’t for centos 7.
And I can not install it

The distribution process discussed here is supported on CentOS 7. If something isn’t working, we can walk you through fixing it (assuming you don’t decide to just stick with PyInstaller) .

thank you.

I just compiled with cx-freeze and it Works.

Thank you for your help :slight_smile:

I’m trying to build a program using pyinstaller - my codebase uses Panda3D really just to render a window and uses more pythonic method in the core, pytorch heavy etc, showbase.taskMgr.step() used to update renders etc - not sure whether the tool that ships with Panda3D would work.

And I am able to get a build done when trying on Ubuntu like:

pyinstaller --windowed --paths=/dir/game/_venv/lib/python3.8/site-package --add-data="_venv/lib/python3.8/site-packages/panda3d/libCgGL.so:./" --add-data="_venv/lib/python3.8/site-packages/panda3d/libpandagl.so:./" --add-data="_venv/lib/python3.8/site-packages/panda3d/etc/Config.prc:etc/" --add-data="assets:assets" main.py

But when I try to build an exe on windows:

pyinstaller --windowed --paths="D:game\_venv\Lib\site-packages"  --add-data="_venv\Lib\site-packages\panda3d\etc;etc" --add-data="assets;assets" main.py

I get this error:

Traceback (most recent call last):
  File "main.py", line 23, in <module>
  File "rlanimate\worlds\main.py", line 19, in __init__
  File "direct\showbase\ShowBase.py", line 339, in __init__
  File "direct\showbase\ShowBase.py", line 1021, in openDefaultWindow
  File "direct\showbase\ShowBase.py", line 1056, in openMainWindow
  File "direct\showbase\ShowBase.py", line 766, in openWindow
  File "direct\showbase\ShowBase.py", line 746, in <lambda>
  File "direct\showbase\ShowBase.py", line 818, in _doOpenWindow
  File "direct\showbase\ShowBase.py", line 647, 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.

And I can see what I believe is the correct config.prc copied into a etc directory in the distribution files, but no luck getting an executable built

Do you have any ideas on what I’m missing here? or any suggestions on how to diagnose what needs to be fix?

So, I tried building without the --windowed option, and when I ran the resulting exe, I got this error

Warning: pandac.PandaModules is deprecated, import from panda3d.core instead
:loader(warning): Unable to load libp3assimp.dll: Path not found
:loader(warning): Unable to load libp3ptloader.dll: Path not found
/c/Users/user/AppData/Local/Temp/_MEI122442/etc

:display(warning): Unable to load libpandagl.so: Module not found
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
  File "main.py", line 25, in <module>
    self.showbase = ShowBase()
  File "direct\showbase\ShowBase.py", line 339, in __init__
  File "direct\showbase\ShowBase.py", line 1021, in openDefaultWindow
  File "direct\showbase\ShowBase.py", line 1056, in openMainWindow
  File "direct\showbase\ShowBase.py", line 766, in openWindow
  File "direct\showbase\ShowBase.py", line 746, in <lambda>
  File "direct\showbase\ShowBase.py", line 818, in _doOpenWindow
  File "direct\showbase\ShowBase.py", line 647, 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.
[25892] Failed to execute script 'main' due to unhandled exception!

I added an add-data argument to copy the libpandagl.so to the compile path as well, and when I can see the file in the dist as well, but I think the code is looking for that and the Config.prc file in the wrong location, as

/c/Users/user/AppData/Local/Temp/_MEI122442/etc

is printed out from -

print(ConfigPageManager.getGlobalPtr().getSearchPath())

Will post an update with how I get on with investigating whether this is indeed what’s causing the exception.

So, as it turned out the Temp files are from building the dist in onefile mode and quite normal, and I was missing the following two files:

CgGL.dll
libp3windisplay.dll

Updated the build command to:

pyinstaller --paths="D:game\_venv\Lib\site-packages" --add-data="libpandagl.so;." --add-data="_venv\Lib\site-packages\panda3d\libpandagl.dll;." --add-data="_venv\Lib\site-packages\panda3d\CgGL.dll;." --add-data="_venv\Lib\site-packages\panda3d\libp3windisplay.dll;." --add-data="_venv\Lib\site-packages\panda3d\etc;etc" --add-data="assets;assets" main.py

and the built exe worked just fine

1 Like