Packaging For a Distributable Version of a Application

OK that worked. But it was saying missing audio plugin p3fmod_audio referenced in PRC data, replacing with p3openal_audio.

As well as, missing modules: [_posixsubprocess]

Is this normal? Did you get this same result?

I don’t actually use it, and of course the result is different.

fmod is commercial, and it must be purchased separately and put in a folder. I don’t know exactly.

As for, _posixsubprocess, most likely it is not installed in the Python that comes with the Panda version. You need to perform pip installation for Python Panda.

1 Like

Oh I see, I was just making sure I wasn’t missing anything. I was able to build my game with the steps you’ve told me but I was unsuccessful when trying to run it.

Is this the same as trying to build it using python3 setup.py bdist_apps? I tried it with this command but I got an error back saying no such file in the directory.

I was able to get the bdist folder after running - C:\Panda3D-1.10.7-x64\python\python.exe -E setup.py bdist_apps. But When I try to open the games application, it doesn’t load.

To be clear, you don’t have to use the version of Python that comes with Panda. It’s less likely to cause compatibility issues, but you can use your own installation of Python 3 I do believe.

Ah, I’m glad that you made progress! :slight_smile:

[edit] I see that you have a separate thread for this–I’ve moved my answer over to that one!

D:\Panda3D-1.10.7-x64\samples\asteroids>C:\Users\Serega\AppData\Local\Programs\Python\Python39\python.exe setup.py build_apps
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: setup.py --help [cmd1 cmd2 ...]
   or: setup.py --help-commands
   or: setup.py cmd --help

error: invalid command 'build_apps'

@Thaumaturge I downloaded a new Python and can’t verify your claim :stuck_out_tongue:

Granted that I’m on Ubuntu:

Now, it’s possible that my installation of Panda provided this version of Python3–I don’t remember how I came to install it. However, Panda-installed commands like “pstats” seem to be located in “usr/local/bin”, while “python3” seems to be located in “usr/bin” (note the call to “which” at the top of the screenshot.

If Python 3 isn’t working on a given system, then perhaps the installation of it has either not placed it in the location expected by the OS, or not updated the relevant environment variable(s).

Regardless of how Linux works, each copy of Python has its own site-packages folder. A Panda is a package.

Nevertheless, I’m using–as far as I see–a version of Python 3 that didn’t come with Panda.

Apparently you installed Panda via Pip, as I mentioned in the message you quoted.

[edit] Argh, sorry, I mis-read–I thought that you said that I had installed Python via pip, not Panda. The resultant response is thus irrelevant, and has been deleted. ^^;; [/edit]

Still, either way, it would seem that I’m using a version of Python that didn’t come with Panda, which was the original claim. :stuck_out_tongue:

How does someone prevent an error like this from happening? What’s the right way to install panda?

I think that the current recommend method is via “pip”–as mentioned on the “download” page, you would do so something like this:
pip install panda3d==1.10.7
Or just:
pip install panda3d

(On my system, a version of pip that uses Python 3 is separately installed, and invoked via “pip3”–it might be worth trying that first, to make sure that you’re using the Python 3 version.)

I don’t know whether pip is available via default under Windows–but it seems simple enough to find out by trying it!

1 Like

Thank you for the quick explanation!
I will try this out! Being in tech for a few years even the simplest things can fix issues. :crossed_fingers:

1 Like

Iv installed python and panda via pip. But I am having a hard time trying to build a distributable version of the game in my IDE. When I run the command python setup.py build_apps. It doesn’t build right and I get this error.

ERROR: Could not find a version that satisfies the requirement panda3d (from -r D:\Visual Studio Code\requirements.txt (line 1)) (from versions: none)
ERROR: No matching distribution found for panda3d (from -r D:\Visual Studio Code\requirements.txt (line 1))

Meanwhile, when I run python3 setup.py bdist_apps, nothing happens. It returns blank. How do I run this exact command properly?

I managed to get bdist_apps run but it failed to build and I got a new error saying. AttributeError: ‘array.array’ object has no attribute ‘fromstring’. Have you ever gotten or seen this error before. If so how do I go about fixing it?

Well, what does your “requirements.txt” file contain?

And are you running this from a computer that’s connected to the internet? The build system looks online for the relevant wheel-files, and if it can’t access the internet it might fail.

(I note that in a following paragraph you mention using “python3”–did you try that when attempting to use “build_apps”?)

That should be correct–I’m not sure of why you’re seeing nothing at all! I would expect at least an error to result.

When you run this command, do “build” and “dist” folders appear in the directory from which you run it? (If they’re already present, what happens if you delete them and then run the command?)

How did you get it to run? That might suggest an answer.

At a guess, did you perhaps run the “setup.py bdist_apps” command with “python” instead of “python3”? That is, did you run “python setup.py bdist_apps” instead of “python3 setup.py bdist_apps”?

If so, it may be that “bdist_apps” doesn’t support Python 2 (which is perhaps the version that your “python” command invokes), instead requiring Python 3. But that is a bit of guess.

You can just forget about the IDE, I told you how to start packaging the game. What you require from the IDE is not its responsibility.

1 Like