Install cx_Freeze from here
Unzip the folder and run these commands from that directory:
Create a new directory for your python script and create a "setup.py" file in the same directory with the following content:
Now run your setup.py from terminal:
NOTE: On El Capitan this will need to be run as root with SIP mode disabled.
To use the py2app framework you must install it first. Do this by opening terminal and entering the following command:
You can also
pip install the packages as :
Then create the setup file for your python script:
Edit the settings of the setup file to your liking, this is the default:
To add an icon file (this file must have a .icns extension), or include images in your application as reference, change your options as shown:
Finally enter this into terminal:
The script should run and you will find your finished application in the dist folder.
Use the following options for more customization:
This modified text is an extract of the original Stack Overflow Documentation created by following contributors
and released under CC BY-SA 3.0