[Solved]py2exe -- how to get the config.prc loaded?

The following link is my starting point:

https://discourse.panda3d.org/viewtopic.php?t=901&highlight=py2exe

No matter how I tried, I just can’t get the Config.prc loaded.

I was so happy when the first time I sucessfully generated the .exe file, but after I removed the panda/bin from my path, it just doesn’t work.

StandardError: No graphics pipe is available!
Your Config.prc file must name at least one valid panda display
library via load-display or aux-display.

I also tried to copy the entire etc folder to my dist folder, or moved the two files from the etc folder to the same folder as my execuable…neither of them worked.

The only available working folder is:

c:\panda3d-1.2.3\etc

Anyway to fix it?

Panda looks in a certain path for your Config.prc file(s). Which path it looks for exactly is configured at build time. Currently, makepanda.py configures the following behavior by default:

(1) The environment variable $PANDA_PRC_DIR, if defined, will be the name of a single directory that is to be searched for prc files.

(2) The environment variable $PANDA_PRC_PATH, if defined, will contain the name of multiple directories, separated by a semicolon (:wink: on Windows, and by a colon (:slight_smile: on Linux, that are to be searched in the specified order for prc files.

(3) If neither of those is defined, the search directory is based on whatever directory the .exe or .dll is located in. Panda will look in /etc, then in /…/etc, then in /…/…/etc, and so on, until a directory is found that contains at least one .prc file.

If you build a custom version of Panda, you can tweak this behavior.

David

Thanks for the details! I’ll try and see if I can get it works :slight_smile: