RustPython is a Python 3 interpreter implemented entirely in Rust, without CPython bindings. It's aimed at Rust developers who want to embed Python scripting into their applications, run Python in the browser via WebAssembly, or explore how a Python implementation looks in Rust. It's not a drop-in CPython replacement for production workloads; the project itself says it's not fully production-ready yet.
hello_embed.rs, mini_repl.rs) included in the repo.__jit__() call on function objects.rustpython -m venv creates a virtual environment, and --install-pip sets up pip when the ssl feature is enabled, so you can install packages from PyPI.cargo run --release (or the installed rustpython binary) for a Python shell, or pass -c to run one-liners.RustPython fits well when you need to add a Python scripting layer to a Rust application without shelling out to a system Python or linking against CPython's C API. Projects like time-series databases and game engines have used it this way, embedding Python for user-defined logic. It also works for running Python logic inside WebAssembly, in the browser or in WASI runtimes, where a native CPython binary isn't an option.
It's a reasonable choice for experimenting with Rust and Python interoperability, for testing how Python code behaves in a sandboxed WASM context, or for tools (like linters) that need to parse or interpret Python without a system Python dependency.
It's not the right fit if you need full CPython compatibility, access to the entire CPython C extension ecosystem, or a production-grade interpreter with guaranteed performance parity. Packaging is also still rough: there's no polished installer, and pip support depends on optional SSL features that require extra system dependencies. If your project depends heavily on C-extension-based packages (numpy-heavy pipelines, for instance), check compatibility carefully before committing.
You need the latest stable Rust toolchain. Install it via rustup.rs if you don't have it, and check your version with rustc --version.
Clone and run directly:
git clone https://github.com/RustPython/RustPython
cd RustPython
cargo run --release -- -c 'print("Hello, RustPython!")'
Or drop into the interactive shell:
cargo run --release
On Windows, set git config core.symlinks true before cloning (the Lib/ directory uses symlinks), and set the RUSTPYTHONPATH environment variable to the Lib path in the project directory.
To install it as a standalone binary:
cargo install --git https://github.com/RustPython/RustPython rustpython
rustpython
For pip support, enable the ssl feature when installing, then run:
cargo install --git https://github.com/RustPython/RustPython
rustpython --install-pip
For WebAssembly (WASI), add the target and build with the freeze-stdlib feature:
rustup target add wasm32-wasip1
cargo build --release --target wasm32-wasip1 --features="freeze-stdlib"
The experimental JIT compiler requires the jit cargo feature plus autoconf, automake, libtool, and clang installed on your system:
cargo run --features jit