pyodide-build#
Build Python packages for WebAssembly.
pyodide-build is the build toolchain for compiling Python packages to WebAssembly via Emscripten. It is the reference implementation of the build toolchain for the Emscripten/WebAssembly Python platform.
This tool is designed to be used with Pyodide, but it can also be used with other Emscripten-based Python runtimes that support the same platform tags that follows PEP 783.
If you’re familiar with python -m build, pyodide-build works the same way — just replace it with pyodide build:
pip install pyodide-build
pyodide build .
This produces a .whl file tagged for the Emscripten platform (e.g., your_package-1.0-cp314-cp314-pyemscripten_2026_0_wasm32.whl) that can be published to PyPI and installed in Pyodide.
Who is this for?#
Note
Pure Python packages do not need pyodide-build. A standard wheel built with python -m build, hatch, flit, or any PEP 517 build frontend is already compatible with Pyodide. pyodide-build is for packages that contain compiled extensions.
pyodide-build is for Python package maintainers who want their package to work in WebAssembly environments — the browser, Node.js, or any Emscripten-based Python runtime. Typical users include:
Package authors adding Pyodide/WebAssembly to their platform support matrix
Library maintainers whose users need the package in JupyterLite, Pyodide, or other browser-based Python environments
How it works#
pyodide-build wraps pypa/build with a cross-compilation layer. When you run pyodide build, it:
Sets up a cross-build environment with Emscripten-compiled CPython headers
Intercepts compiler calls (
gcc,g++,ld, etc.) and redirects them to Emscripten (emcc,em++)Translates compiler flags for WebAssembly compatibility
Produces a standard wheel with the appropriate platform tag
Your existing setup.py, pyproject.toml, CMakeLists.txt, or meson.build works as-is — pyodide-build handles the cross-compilation transparently.
Where to start#
Build your first WebAssembly wheel in 5 minutes.
Add Pyodide to your existing cibuildwheel CI pipeline.
pyodide venvVerify your wheel works in a Pyodide environment.
Communication#
Discord: Pyodide Discord
Blog: blog.pyodide.org
Mailing list: mail.python.org/mailman3/lists/pyodide.python.org/
Stack Overflow: stackoverflow.com/questions/tagged/pyodide