Serdar Yegulalp
Senior Writer

PyOxidizer uses Rust to make Python executables

news
Jan 3, 20192 mins

A new project written in Rust aims to make it easier to distribute Python applications as standalone binaries

python
Credit: Mark Gillow

A new project, written in Rust, aims to make it easier to package and distribute a Python application as a standalone binary executable—something that has long been a pain point for Python developers.

PyOxidizer, according to its GitHub README, is “a collection of Rust crates that facilitate building libraries and binaries containing Python interpreters.” With PyOxidizer, its developers claim, it’s possible to build an executable for a Python app that embeds a Python interpreter, with no other runtime dependencies.

PyOxidizer requires an installation of Rust 1.31 or better, and packages only apps written with Python 3.7. To use PyOxidizer, the developer creates a TOML file that describes how to embed a given Python app, then builds and runs PyOxidizer with an environment variable pointing to that TOML file.

PyOxidizer stands apart from other packaging solutions in using a custom build of the Python interpreter that is designed to be statically linked and embedded into another program. Other solutions, like PyInstaller, redistribute the existing stock CPython .DLL—convenient and compatible, but not very flexible. PyOxidizer also packs the bytecode for the Python app into the executable image and loads it directly from memory (fast), rather than from the file system (slower).

Like PyInstaller, though, PyOxidizer does not perform any optimizations on the Python code. Another project, Nuitka, not only compiles Python apps to standalone executables, but also tries to apply performance optimizations to the compiled code. However, Nuitka is still considered a beta-level project, and a great many of the projected performance improvements aren’t available yet.

PyOxidizer itself is still a very early-stage project. It can generate only Linux binaries because one of the upstream projects it depends on, the embeddable version of CPython, is currently available only in Linux builds.

Serdar Yegulalp

Serdar Yegulalp is a senior writer at InfoWorld. A veteran technology journalist, Serdar has been writing about computers, operating systems, databases, programming, and other information technology topics for 30 years. Before joining InfoWorld in 2013, Serdar wrote for Windows Magazine, InformationWeek, Byte, and a slew of other publications. At InfoWorld, Serdar has covered software development, devops, containerization, machine learning, and artificial intelligence, winning several B2B journalism awards including a 2024 Neal Award and a 2025 Azbee Award for best instructional content and best how-to article, respectively. He currently focuses on software development tools and technologies and major programming languages including Python, Rust, Go, Zig, and Wasm. Tune into his weekly Dev with Serdar videos for programming tips and techniques and close looks at programming libraries and tools.

More from this author