What Python Packages Can I Run with Pyodide?

Updated

Pyodide supports any pure Python package that has a wheel available on PyPI, and it also ships with many packages that have C, C++, or Rust extensions already ported for use with it. You install additional packages at runtime with micropip. If a package you need is pure Python and published as a wheel, it should work; if it has compiled extensions, check whether it is already in the Pyodide distribution or has been ported.

What Pyodide is

Pyodide is a port of CPython to WebAssembly/Emscripten, distributed as a Python distribution for the browser and Node.js. It makes it possible to install and run Python packages in the browser with micropip.

When used inside a browser, Python has full access to the Web APIs. Pyodide also provides a JavaScript ⟺ Python foreign function interface, so you can mix the two languages in your code, including error handling across the boundary (throw an error in one language, catch it in the other) and async/await.

Which packages are supported

Package type Support
Pure Python packages with a wheel on PyPI Supported
Packages with C, C++, or Rust extensions Many have been ported for use with Pyodide
General-purpose ported packages regex, PyYAML, cryptography
Scientific Python packages NumPy, pandas, SciPy, Matplotlib, scikit-learn

The practical rule: start from the wheel. A pure Python package with a wheel available on PyPI is supported. For anything with compiled extensions, the package either needs to be part of the Pyodide distribution or have been ported; the list above covers many common cases, but it is not a guarantee for every package.

How to install and run packages

Packages are installed in the browser with micropip. The general flow is:

  1. Load Pyodide in your page or Node.js environment.
  2. Use micropip to install the package you need.
  3. Import and use it like normal Python.

The expected result is that the package is fetched and made available to your Python code running in the same environment. If installation fails, the usual cause is that the package is not pure Python and has no port available for Pyodide.

Where to go next

  • Use a hosted distribution of Pyodide: see the Getting started documentation.
  • Host Pyodide yourself: download it from the releases page and serve it with a web server.
  • Use Pyodide with a bundler: see the documentation on Working with Bundlers.
  • Maintain a Python package: see the pyodide-build documentation.
  • Add a package to the Pyodide distribution: see the pyodide-build documentation.
  • Experiment with or contribute to the runtime: see the documentation on Building from source.

You can also try Pyodide in a REPL directly in your browser with no installation needed.