Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
PyBevy: A Python Real-Time Engine Built on Bevy
Beta. Python 3.12+. API evolving — breaking changes expected. Independently developed, community-maintained. Not affiliated with the Bevy project.
pybevy.com — Project website & documentation
Write Python, save the file, and see your 3D scene update. Use NumPy, JAX, and PyTorch in the same process as a real 3D renderer. And when you want it, the AI can join the loop — it writes code, sees the result, and iterates.
- Fast hot reload — edit code, see changes near instantly, no restart, no recompile
- Built on Bevy's renderer and ECS — PBR, volumetric fog, cascaded shadows, bloom, SSAO
- Python ecosystem in-process — NumPy, JAX, PyTorch, Numba — just import
- Optional AI feedback loop — the AI writes Python, reloads, inspects the running scene, and iterates
- If you know Bevy's Rust API, PyBevy should feel immediately familiar

Getting Started
Installation
Pre-compiled wheels are available for the following platforms:
| Platform | Architecture |
|---|---|
| Linux | x86_64 |
| macOS | ARM (Apple Silicon), x86_64 |
| Windows | x86_64 |
Browser sandbox is in development — follow #12 for progress.
Linux System Dependencies
PyBevy's pre-built wheels link against system display and audio libraries. On most desktop distributions these are already present.
If you see an ImportError mentioning libwayland-client.so or libasound.so:
# Debian/Ubuntu
# Fedora/RHEL
Docker / headless environments also need a software GPU driver:
ALSA warnings about missing audio devices are harmless and can be ignored.
Free-Threaded Python (3.13t+)
PyBevy supports Python's free-threaded mode (PEP 703). Non-conflicting Python systems run truly in parallel on separate cores via Bevy's multi-threaded scheduler — no GIL serialization. Validated on CPython 3.14t. Performance depends on workload and scene complexity; see Benchmarks for methodology and numbers.
Note: The Numba JIT path (View API Tier 3) is not yet available on free-threaded Python —
llvmlitedoes not ship 3.14t wheels yet. Tracked in #8.
Quick Example
Parent-child entity hierarchy with a rotating parent cube. The child cube inherits the parent's transform automatically.
"""Marks entities that should rotate."""
=
=
# Parent cube — rotates
=
# Child cube — follows the parent
return
Save this as main.py and run with hot reload:
Edit the code — the engine hot reloads near instantly, no restart, no recompile.
The --full flag reloads everything on each change, including setup systems. Without it, only Update systems are reloaded — faster for iterating on runtime behavior once your scene is set up.
Native Plugin Approach (Rust + Python)
If you already have a Rust Bevy application, you can embed Python systems into it with PyBevyPlugin. Prototype in Python, ship critical paths in Rust.
Security:
PyBevyPluginembeds a full CPython interpreter with unrestricted host access. Never execute untrusted Python code. We advise against using this for user-submitted plugin/modding systems without external sandboxing.
// main.rs - Your existing Rust Bevy application
use *;
use PyBevyPlugin;
# game_logic.py
= 1.0 # Change this and press F5!
*=
See docs/native-plugin.md for the full guide, including #[derive(PyComponent)] for exposing Rust components to Python and hot reload details.
AI Feedback Loop
PyBevy includes a built-in MCP server that lets AI agents write Python, reload the scene, capture screenshots, inspect entities, and iterate — automatically. The AI sees what it builds.
Also works with Cursor and other MCP-compatible editors. See docs/mcp.md for full setup.
Bevy Compatibility
PyBevy versions target specific Bevy versions:
| pybevy | Bevy |
|---|---|
| 0.2.x | 0.18 |
| 0.1.x | 0.18 |
PyBevy follows Bevy's API conventions as closely as possible and targets full coverage of Bevy's public API. Core modules like transforms, lighting, cameras, and input are fully covered; others are in progress. See API Coverage for current per-module stats and Limitations for known constraints.
Limitations
- No built-in physics — use NumPy or JAX for physics computation, PyBevy for visualization.
- Desktop only — Linux, macOS, Windows. No mobile.
- Code only — no visual editor.
- API is evolving — see Limitations for known constraints.
Documentation
- pybevy.com — Project website
- Examples — Runnable examples covering 2D, 3D, ECS, animation, and more
- API Coverage — Per-module Bevy API coverage stats
- Limitations — Known limitations
Community & Contributing
- Discord: Pybevy Discord — questions, discussion, showcases
- Contributing: See CONTRIBUTING.md
License
All code in this repository is dual-licensed under either:
at your option.
By contributing, you agree your work will be released under both licenses.
When you want it, the world runs itself.