I am having a hard time packaging my game with “setuptools”. When I enter the command "python3 setup.py bdist_apps" nothing happens, no errors, nothing. Following the manual. Pands3D says to type “python setup.py build_apps” and I am then hit with an error, setup.py: Can’t open file 'setup.py: [Errno 2] No such file or directory.
What am I doing wrong? Yes, I have the requirements.txt file, if wondering.
from setuptools import setup
setup(
name = "Panda-chan and the Endless Horde",
options = {
"build_apps" : {
# Files that we want to include. Specifically:
# * All of our image-files (.png)
# * All of our sound- and music-files (.ogg)
# * All of our text-files (.txt)
# * All of our 3D models (.egg)
# - These will be automatically converted
# to .bam files
# * And all of our font-files (in the "Font" folder)
"include_patterns" : [
"**/*.png",
"**/*.ogg",
"**/*.txt",
"**/*.egg",
"Fonts/*"
],
# We want a gui-app, and our "main" Python file
# is "Game.py"
"gui_apps" : {
"Panda-chan and the Endless Horde" : "Game.py"
},
# Plugins that we're using. Specifically,
# we're using OpenGL and OpenAL audio
"plugins" : [
"pandagl",
"p3openal_audio"
],
# Platforms that we're building for.
# Remove those that you don't want.
"platforms" : [
"macosx_10_6_x86_64",
"win_amd64",
]
}
}
)
Obviously, you should go to the console directory where it is located setup.py, or run the console from the script folder. As an option to specify the full path to setup.py.
But are you running the terminal command from that folder? That is, when you run the command, is the terminal/console pointed at the folder that contains “setup.py”?
Okay, and is “setup.py” in the folder “C:\Users\<your user name>”?
You see, as of that screenshot, the terminal is pointing at the above-mentioned directory. If your “setup.py” file isn’t in that directory, you might want to redirect the terminal to whatever directory it is found in.
So, let’s say that your game, along with the “setup.py” file, is located in “C:\Users\<user name>\MyGames\TheNameOfTheGame\”. In your terminal, presuming that you started in “C:\Users<user name>” as above, you’d enter the following:
cd MyGames\TheNameOfTheGame
This should point the terminal to the “TheNameOfTheGame” directory, being the location of the “setup.py” file, allowing you, hopefully, to run the setup procedure.
(As a convenience, I don’t know about Windows, but I know that in Ubuntu Linux–or at least my current version thereof–you can open a terminal directly to a given directory. This is done by opening the directory in the file manager, then right-clicking on some white-space and selecting “Open in terminal”. Perhaps there’s a similar option in Windows!)
I’m not sure why the terminal isn’t targeting my folder where I have my game located. I am using Microsoft visual studios and I will have to do some googling to figure out how to do it.
Thnk you for your help once again and the many times before that. I couldn’t have gone though without your help, thank you sir!
To open the console from the script folder, first go to this folder and type cmd in the address bar. Alternatively, hold key the shift while in the script folder and open the console from the context menu.
When I type cmd and run Python.exe I am getting syntax errors when I try to load setup.py from my drive. I am a little confused about what I am supposed to do here. Am I suppose to type -D setup.py build_apps in the console?
What, precisely, is the command that you’re using, and from what directory are you calling it? And what errors are you getting, specifically?
Just a quick correction: serega’s command-line above uses “-E”, not “-D”. If you’ve been trying “-D”, then you may have been getting errors for that reason.
I installed panda from the website and not by pip. I didn’t know there was a difference. When I type this command in nothing happens, no errors. The terminal just returns blank. Do I have to uninstall and reinstall via pip?
Ok I will uninstall python and download it though panda.
Just replace this address with your own with the installed Panda.
D:\Panda3D-1.10.7-x64\python\python.exe
You can also show the address of the example asteroids, then I can give the exact command.
You don’t actually need to delete the installed Python, the SDK version has its own copy. My example uses it. However, if you are using a common Python with VS, you must first install a Panda for it via pip to work.
I am using VS Code. I am able to run my game which is using panda with no problem. I went ahead and installed the new update without using pip. Along with the python. I see no issues loading the game.
This is the error I’m getting unless I am doing something wrong.
Ohhh my gosh I am sorry I didn’t know that’s what you meant that’s what I had to do. I was totally off and confused. I apologize for not understanding what you were telling me to do before. This whole process of learning everything about python is hard sometimes especially when I can’t figure out what I am doing wrong. I appreciate your help and I will do what you have suggested and hope for the best.