Cx_Freeze compiles Python scripts into executable files using a set of helpful utilities.
For instance, the Freeze utility included with Python requires a complex environment, a source distribution, and a C compiler and linker. As a result, creating executables using this method is much slower than the other options. Similarly, py2exe is only intended for Windows development, while cx_Freeze caters to cross-platform needs. Installer relies on import hooks, which means that the development and runtime environments differ significantly.
So how does cx_Freeze work? It creates a base executable containing code for unpacking the list of frozen modules, starting up the Python interpreter, and passing control to the script that is being frozen. The script is then searched for all references to modules, which are byte-compiled and written to the end of the base executable. If the modules are extensions written in C, they must also be included in the deployment path for the frozen executable.
To install cx_Freeze, extract the archive into a directory and ensure that you have gcc and Python development files and libraries available. Then, run the following commands:
python MakeFrozenBases.py
python FreezePython.py --no-copy-deps FreezePython.py
These commands will leave your directory in a state that is identical to a binary installation. Note that on Windows, you'll need to have mingw32 installed in order for these scripts to function correctly.
Version 4.1: N/A