Skip to main content
Pyodide is full CPython compiled to WebAssembly, run in a worker, with packages such as numpy loaded on import. It has no host files or network: the files it opens are the workspace’s, under the same mount modes and permissions as shell commands. Each command starts a fresh interpreter. TypeScript SDK only, in Node and in browsers.

Installation

In a browser, the page must be cross-origin isolated for the worker; see worker and browser setup.

Usage

Packages

Pyodide’s packages, such as numpy, load when a program imports them. The first import downloads the package from the Pyodide CDN; Node keeps it beside the installed pyodide package for later runs.
A package from PyPI cannot be installed at run time: micropip.install fails. Put its pure-Python wheel on a mount and list it in sys_path.

What is wired

Anything built on these calls, such as os.path, pathlib, glob, shutil and json.load, works too. Files written outside the mounts stay in memory and are lost when the run ends.