I am new to using python on Mac. I created an app using Py2App for Mac. The app works fine through the terminal but not through the double click. So now I am trying to use PyInstaller after reading some of the questions here.
I am using a shared cloud MacOS with Sonoma 14.3.
Installation
Install python3.11
JupyterLab/VS Code/Text editor - I am using Sublime on Mac
Pip3 install hl7
$ pip3 install -U py2app
Setup
Create a python file with required code for the project.
Eg: TestLaunch09.py
Create a new file setup.py in the folder where the TestLaunch09.py resides.
In the setup.py enter the following and save the file.
`from setuptools import setup
APP = ['TestLaunch09.py']
DATA_FILES = []
OPTIONS = {
}
setup(
app = APP,
data_files = DATA_FILES,
options={'py2app':OPTIONS},
setup_requires=['py2app','hl7'],
)`
At the terminal to create the clickable app for Mac
$ python setup.py py2app
A new dist folder is created
Inside the dist there is an icon for App with the name ‘TestLaunch09’. The app can be executed at the terminal but clicking on the icon does not work.
$ TestLaunch09.app/Contents/MacOS/TestLaunch09
executes the app through terminal
Errors
Launch error
See the py2app website for debugging launch issues
enter image description here
Have added exception handling to the code.
Tried iterations of code.
Added log file to see if error is captured but unable so far.
Is there an issue with Py2app. I am expecting the double click of the app to work.
Kripa Ram is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.