Python py2app Tutorial - Making a Standalone Distributable Application with Icon
Why Stack Overflow recommends it
Stack Overflow users link it as the step-by-step reference for building a py2app bundle on macOS, and many askers quote its setup.py while troubleshooting their own builds.
Recommended by 1 people across 1 different months, 2018 to 2020.
What it is
A short screen-recorded tutorial showing how to package a Tkinter Python script into a standalone macOS application using py2app, including a custom .icns icon and bundled data files. It walks through a setup.py with options like iconfile, argv_emulation and certifi, presented by the TheBlackBerryChannel.
What people said
Recommends Siddharth Dushantha · 2019-03 · Stack Overflow · on “Pyinstaller executable only works on same machine [python]”
Since you are on MacOS, I would recomend you use `py2app`. Here is a very helpful video on how to use it: [this video]
Cites C.Radford · 2018-09 · Stack Overflow · on “Build/Run Python Executable in terminal that requires cmd line arguments using Py2app”
I have a .py file that is a standalone program that takes in two command line arguments using argparse Followed the following youtube vid [this video] : ap = argparse.ArgumentParser() ap.add_argument("-1", "--Image", required=True, help="Image to be trained on") ap.add_argument("-2", "--SaveName", required=True, help="Name of file to be saved") args = vars(ap.parse_args()) image = cv2.imread(args["Image"]) fileName = (args["SaveName"]) The following is my setup.py file for py2app from setuptools import setup APP = ['DataTraining.py'] DATA_FILES=[] OPTIONS = { 'argv_emulation':True, 'packages':['certifi'], } setup( app=APP, data_files=DATA_FILES, options={'py2app':OPTIONS}, setup_requires=['py2app
Cites ecjb · 2019-02 · Stack Overflow · on “Python: Making a standalone executable file on MacOS with py2app”
I have an application in a python script my_app.py and want to make a standalone executable out of it on a MacOS (10.14). Following the video-tutorial here [this video] , I entered sequentially the following commmands: pip install virtualenv virtualenv venv --system-site-packages source venv/bin/activate pip install py2app cd /path/to/my_app.py python setup.py py2app -A with the following setup.py file: from setuptools import setup APP = ["my_app.py"] DATA_FILES = [] OPTIONS = { "argv_emulation": True, "packages": ["certifi"], } setup( app = APP, data_files = DATA_FILES, options = {"py2app": OPTIONS}, setup_requires = ["py2app"] ) but got the following error message: Traceback (most recent call l
Cites yts61 · 2020-08 · Stack Overflow · on “What is the proper way to turn a python app into a standalone app with py2app?”
I have built a simple python app with Tkinker, which has a super small sqlite file with it. The app is here, [LINK] Having failed in pyinstaller many times, i am turing to py2app in the hope to make one standalone app file which i can share around. I googled and followed this youtube tutorial, [this video] , and again failed the mission. My setup.py file is like the one below, from setuptools import setup APP = ['frontend.py'] DATA_FILES = ['books.db','backend.py'] OPTIONS = { 'iconfile':'favicon.ico', 'argv_emulation': True, 'packages': ['certifi'], } setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], ) In the terminal, i tried python setup.py py2app -