Skip to main content
Runs Python in WebAssembly inside Mirage, with access to workspace files. Settings and notes: WASI.

Install

Without it, WasiRuntime(...) raises ImportError. Download and unzip a release from cpython-wasi-build, then point home, or MIRAGE_WASI_HOME, at the unzipped directory.

Usage

In the Python SDK

  • A read-only mount, or a session narrowed to read, refuses a write at open() with OSError: errno 30 on the host and Monty, or preview1 errno 69 under WASI.
  • The CPython build is read-only in the run. A mount at / coexists with it: each mount wins under its prefix.
  • A run starts in the shell’s working directory; a missing one fails before any code runs. A direct execute() runs in its context’s cwd.
  • A script runs as in CPython: __file__ is absolute, tracebacks quote its lines, and sys.path[0] is its directory (-P and -I leave it off).
  • The first run compiles python.wasm and caches python.cwasm beside it; later runs start in milliseconds. A timeout stops the run.