How to resolve this error: "Exception: No graphics pipe is available!"

Hi,

I’m trying to package my python code into an EXE file, using PyInstaller. I’m using Linux OS.

I’m facing this warning:

Warning: unable to auto-locate config files in directory named by "<auto>etc".

and this error:

super(EventBasedEditor, self).__init__(self, **kwargs)
  File "direct/showbase/ShowBase.py", line 341, in __init__
  File "direct/showbase/ShowBase.py", line 1026, in openDefaultWindow
  File "direct/showbase/ShowBase.py", line 1061, in openMainWindow
  File "direct/showbase/ShowBase.py", line 771, in openWindow
  File "direct/showbase/ShowBase.py", line 751, in <lambda>
  File "direct/showbase/ShowBase.py", line 823, in _doOpenWindow
  File "direct/showbase/ShowBase.py", line 652, 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.
Fatal Python error: Aborted

I’ve tried to locate that Config.prc file.

This is its content:

###########################################################
###                                                     ###
### Panda3D Configuration File -  User-Editable Portion ###
###                                                     ###
###########################################################

# Uncomment one of the following lines to choose whether you should
# run using OpenGL, DirectX or TinyPanda (software) rendering.
# There can only be one load-display line, but you can use
# multiple aux-display lines to specify fallback modules.
# When the module indicated by load-display fails, it will fall
# back to the next display module indicated by aux-display,
# when that fails, the next aux-display line, and so on.

load-display pandagl
aux-display p3headlessgl
#load-display p3tinydisplay

# These control the placement and size of the default rendering window.
# A value of -2 for the origin means to center it on the screen,
# while -1 lets the window manager choose the position.

win-origin -2 -2
win-size 800 600

# Uncomment this line if you want to run Panda fullscreen instead of
# in a window.

fullscreen #f

# The framebuffer-hardware flag forces it to use an accelerated driver.
# The framebuffer-software flag forces it to use a software renderer.
# If you set both to false, it will use whatever's available.

framebuffer-hardware #t
framebuffer-software #f

... (There's more)

How do I fix this? It seems like the config.prc wasn’t initialized inside the exe internal file?

Hi, welcome to the forums!

Either:

  1. it can’t find the config file, meaning you didn’t pack it in the etc folder relative to the .exe file, or otherwise load the important things (like load-display line, in this case) programmatically
  2. You haven’t bundled the actual display plug-in referenced by the load-display line, such as libpandagl.so/dll, with the application

Any reason you’re not using the built-in packaging tool? It can package all these parts automatically.

1 Like
Any reason you’re not using the built-in packaging tool? It can package all these parts automatically.

Thanks for the advice. It’s most likely because I didn’t know it was possible. When you suggest that, do you mean that I could package my whole project, including other packages and imported modules, in addition to Panda3D, just by using the built-in packaging tool of Panda3D?

it can’t find the config file, meaning you didn’t pack it in the etc folder relative to the .exe file, or otherwise load the important things (like load-display line, in this case) programmatically

You’re right. I kinda solved this problem, as my mistake was that I did this: (in the “spec” file of PyInstaller)

datas=[('.venv/lib/python3.10/site-packages/panda3d/etc/*','panda3d/etc')]

Instead of this:

datas=[('.venv/lib/python3.10/site-packages/panda3d','panda3d')]

And for some reason, that linking (using asterik) permutated the whole order of the files hierarchy.

Then I made sure that all of the files/folders were copied properly, and I could find the missing “Config.prc” file. It was located properly.

Docs for distributing Panda3D applications can be found here. The tools Panda ships with (build_apps and bdist_apps) work similar to PyInstaller (including support for third-party modules) with some differences being:

  • build_apps is purpose built for Panda and can handle things like PRC data and converting EGG files to BAM
  • build_apps can build for all platforms from a single host