cx_Freeze

cx_Freeze

Freeze Python scripts into executables

Description

You write a handy Python tool, send it to someone, and their machine has no Python, let alone the dozen libraries you used. Ask people to set up an environment and pip install first, and half of them give up.

cx_Freeze removes that step. It bundles your script with the Python interpreter and every library it uses, freezing it into a standalone executable that runs with a double-click and no Python install. The frozen program runs as fast as the original script.

Unlike py2exe (Windows only) or py2app (Mac only), cx_Freeze is cross-platform and works on pretty much any system Python runs on; you build once per platform from the same configuration. It supports Python 3.10 through 3.15 and installs with a single pip or conda command.

Features



One-command freezing: point the bundled cxfreeze command at a script and get the executable plus the shared libraries it needs in an output folder.

Config-driven builds: for bigger projects, put the setup in a setup script or pyproject.toml, listing modules to include or exclude and data files to ship, so every build comes out the same.

Installers: build MSI installers on Windows, .app bundles and DMGs on macOS, and AppImage, deb and rpm packages on Linux.

Windows services: freeze a Python program to run as a Windows service for things that need to stay in the background.

Full control: when you need finer control, call its internal classes and modules directly and decide how dependencies are collected and files laid out.