Make an executable Python Program

Use PyInstaller to make an executable Python program.
  1. 1

    Get a copy of PyInstaller

    pyinstaller.org

    download and unpack it somewhere, you don't install PyInstaller, it becomes your project folder from where you create the exe. Weird I know

    sourceforge.net/projects/pyinstaller/files/2....

  2. 2

    Fetch a copy of the Python Program

    Get a copy of the Python program you want to install either with

    git clone

    or

    just downloading and unzipping it somewhere on your harddrive.

    Install all of the dependencies in a virtualenv. However matplotlib and numpy are best installed globally, they don't seem to install nicely into a virtualenv.
  3. 3

    Run this command from the command line to generate the exe

    The command should be run from the PyInstaller directory you unzipped earlier:
    /path/to/virtualenv/python pyinstaller.py --onefile /path/to/your/program/main.py --icon=/path/to/your/icon.ico
    This will create the exe in the folder:

    pyinstaller-2.0/name-of-program/dist/name-of-program.exe
  4. 4

    Zip up the exe along with any required files

    Files to consider including in the zip are:

    - README.txt
    - Config files
    - version.txt

    Here is how I create my version.txt
    git log -n 1 > version.txt
    from the git repository folder, and copy that version.txt into the zip alongside the exe file.