Skip to content

Latest commit

 

History

History
55 lines (38 loc) · 1.23 KB

BUILD.md

File metadata and controls

55 lines (38 loc) · 1.23 KB

Build

How to compile python into executables for distribution.

Environment

# list available py versions
pyenv install -l

# install version
pyenv install 3.12.3

# set version
pyenv global 3.12.3

Requirements

# update pip
python -m pip install --upgrade pip

# install project packages
pip install -r requirements.txt

The packages will need to be re-installed if you change python versions.

Compile

# install / update compiler
python -m pip install -U nuitka

# create executable
python -m nuitka generate.py

Additional information can be found on the Nuitka Tutorial Setup and Build page.

Results

Package Size
Numpy 10 MB
Python 6 MB
Pillow 3 MB
Other 1 MB
TOTAL 20 MB

The final app size is relatively large since pre-compiled package dll's get bundled into the executable, rather than getting tree-shaken / re-built. This results in a lot of dead code, but the end result is much more portable and user friendly.