Problem generating my .exe


#1

Hello, my problem is that I am trying to create the executable or the installer for my project and I am having many problems to be able to create the final part of my project.

The project, if I run it from the Pycharm compiler works perfectly.

At first I used packp3d to generate the .p3d file of my project, once I generated it, I tried to use panda3d.exe to run it and it gave me problems because in my project I use the pymsgbox library installed with pip and packp3d is not able to import that module. Since it did not work for me to use packp3d,i discard using it.

I have also tried with pyinstalle. When executing it, it generates the .exe but when I try to execute, it tells me that no graphics pipe is available, this has me very worried because my project executing it from the compiler works perfectly and I do not complain about anything, it is as if creating the .exe is not able to read the file config.prc.

I do not know what to do anymore, I’m in need of creating the. exe to finish my final year job at the university.

If someone can help me out


#2

If it says “no graphics pipe is available”, that usually means one of two things:
(1) etc/Config.prc file is missing
(2) libpandagl.dll is missing

You should make sure these files are present in the directory where the executable (or where the other libraries) reside.


#3

You could also try using the new (currently in development) distribution tool called deploy-ng.
Here’s a manual page for it:
panda3d.org/manual/index.php … Setuptools
Here are the newest (at the time of writing) wheels (to install with pip):
buildbot.panda3d.org/downloads/1 … 433b23d14/
Here’s the github branch:
github.com/panda3d/panda3d/tree/deploy-ng
And a sample using it:
github.com/panda3d/panda3d/tree … /asteroids

Even if I had some problems with it, rdb and Moguri are doing a great job fixing any bugs so far, and most of the problems I had where my fault anyway. I think it’s a better tool then packp3d+pdeploy.

And I’m not writing this so that more people do test it, so that all the hidden bugs can be found, but this is the internet where people sometimes lie :mrgreen:


#4

Thank you very much for the prompt response, in the end it was the solution proposed by rdb. Copy the etc / config.cfg directory to the executable directory and ibpandagl.dll library.

Now it works perfectly.

However, I’m going to take a look at the solution proposed by wezu, just as Panda3D’s own is more consistent since I have to copy the models / folder to my executable directory and it is not as encapsulated as it should be.

Thank you very much.


#5

I’m sorry to ask again but the program does not work as well as I thought.

The executable that I created works well on the computer on which I have developed the application, the problem comes when I try to run it on another computer.

The problem is that it correctly reads the config.prc file (I had to change the environment variable in my program when it was executed using:

os.environ ["PANDA_PRC_DIR"] = os.getcwd ()
 os.environ ["PRC_DIR"] = os.getcwd ()
os.environ ["PANDA_PRC_PATH"] = os.getcwd ()
 os.environ ["PRC_PATH"] = os.getcwd ()) 

but when you try to find the graphic libraries to boot the application does not include them, I have the files libpandadx9.dll, libpandagl.dll and libp3tinydisplay.dll in the same directory in the that my Main.exe is located but it seems that it does not find anything to load.

my Config.prc file is like this:

load-display pandagl
aux-display pandadx9
aux-display pandagles
aux-display p3tinydisplay

and the output when I execute it is the following:

C: \ Users \ DIEGO \ Desktop \ dist \ main> main.exe
Warning: pandac.PandaModules is deprecated, import from panda3d.core instead
: audio (error): load_dso (libp3openal_audio.so) failed, will use NullAudioManage
r
: audio (error): Path not found
: display (warning): Unable to load: Module not found
: display (warning): Unable to load: Module not found
: display (warning): Unable to load: Path not found
: display (warning): Unable to load: Module not found
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
  File "main.py", line 300, in <module>
  File "main.py", line 33, in __init__
  File "direct \ showbase \ ShowBase.py", line 679, in openWindow
  File "direct \ showbase \ ShowBase.py", line 665, in <lambda>
  File "direct \ showbase \ ShowBase.py", line 731, in _doOpenWindow
  File "direct \ showbase \ ShowBase.py", line 570, 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.
[2344] Failed to execute script main

C: \ Users \ DIEGO \ Desktop \ dist \ main>

Config.prc to what directory is going to find these graphic libraries?

Should I go look for them at the same place where Config.prc is not?

On the other computer if I delete these * .dll files if it complains and does not execute it but when I put them back in the directory where I have the Config.prc it runs without problems, it seems that the problem is moving the application to another computer where I do not have Panda3D installed.

I have to say that the executable I did with pyinstaller


#6

Hmm, you should be able to force where these are located using the plugin-path prc variable, for example, if they are in the parent directory of the directory containing the etc files:

plugin-path $THIS_PRC_DIR/../

You may also try and see whether prepending the directory containing the dlls to the PATH environment variable helps.

However, as long as the .dlls are in the same directory as the .exe, it should work, so I am surprised that you are running into all these issues.


#7

Doing some tests on the computer where the application works for me (where I developed the program), I see that on the computer where I have not developed the program, in which I do not have Panda3D installed, the problem lies not in not find the * .dll files, the problem is that it does not load them.

You are having problems loading them not when you find them. The output that shows me on screen when modifying the config.prc file with the values ​​of
notify-level info
default-directnotify-level info
is:

M: \ pfg \ Rapiro \ dist \ main> main.exe
: display: loading display module: libpandagl.dll
: display (warning): Unable to load: Module not found
Known pipe types:
(all display modules loaded.)
Traceback (most recent call last):
  File "main.py", line 300, in <module>
  File "main.py", line 33, in __init__
  File "direct \ showbase \ ShowBase.py", line 679, in openWindow
  File "direct \ showbase \ ShowBase.py", line 665, in <lambda>
  File "direct \ showbase \ ShowBase.py", line 731, in _doOpenWindow
  File "direct \ showbase \ ShowBase.py", line 570, 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.
[7612] Failed to execute script main

As you can see if it finds the file.dll but is not able to load it.

There it escapes me as the library libpandagl.dll is loaded

Should I touch something in the code before creating the .exe?


#8

I write again to say that I have already solved it.

The solution is brute force but it has worked for me.
I have copied all the files that are in the folder / bin of my panda3d to the folder where I have created the .exe and the config.prc as well as the libpandagl.dll file

It seems that not only is necessary the file libpandagl.dll to start the program but some more, as I do not know how to start that file when copying them all and it works perfectly for me.

My project is going to happen as a compressed folder where inside all the files are as much of image as of models and also the executable one.

This way it works for me and I dont want to give it more laps.

The only thing that bothers me is that when executing it, the message always appears on the command screen:

OnscreenText.configure: mayChange == 0

It must be of the Onscreentext type objects that I use in my program but I do not know how to do so that they do not write anything. IF someone knows it, it would be the end of the hard work.

Thank you very much.


#9

At a guess, you have an OnscreenText object, and are trying to change the text that it displays, but haven’t told the object that it should expect such changes. (The error is indicating that “mayChange” is “0”–i.e. “False”–which I imagine isn’t likely to be a problem unless you’re attempting to change the object’s text.)

As described here, “mayChange” is one of the parameters that may be given to OnscreenText, used when the text of that object is expected to change after construction.


#10

Thanks, that’s it.

I have put the parameter maychange = 0 on the Onscreentext objects.

I’m going to look at it to see if I’m really trying to change the text of the object.

Thank you


#11

I’m pretty sure that “0” is the default value for “mayChange”–in other words, that “mayChange = 0” is effectively in place if you don’t specify otherwise. The error seems to be complaining that “mayChange” has the value “0”, despite a change being requested.

In other words, if you are changing an OnscreenText, the solution would presumably be to give that specific object the parameter “mayChange = 1”.