- Operating System: macOS Catalina 10.15.7
- Python Version: 3.10.1 (latest)
I would like to convert a .py file into a standalone app bundle for macOS and an executable for Windows. Said .py runs within my system terminal, and when I create my executable/app bundle, I want the terminal to run in the background.
Currently, I run my .py file in a virtual environment with the required modules, operating on Python 3.10.1. I do so by activating the environment and running:
python /main.py
in my file directory within my terminal. This runs my script just fine within the terminal, but this is not the final product I want and I'm having trouble converting it into an app bundle.
I have tried using py2app to achieve this, first running:
py2applet --make-setup main.py
in my program directory in order to make the setup file, then by running:
python setup.py py2app -A
to make the Python alias. The alias runs fine when I put click on the unix executable within Contents>MacOS>myprogram.py, but it doesn't run at all when I delete my dist and build folders and remake them without the alias. It says "Launch Error: See the py2app wesbite for debugging launch issues". I visited the website but am still unsure what to do about this.
So to summarize, I have two goals:
- Create sucessful standalone app bundles and executables for my script without recieving a launch error.
- Run said executable or app bundle in the background where the terminal is not visible if I manage to complete goal one sucessfully.