Micropip API

micropip.install(requirements: Union[str, List[str]])

Install the given package and all of its dependencies.

See loading packages for more information.

This only works for packages that are either pure Python or for packages with C extensions that are built in Pyodide. If a pure Python package is not found in the Pyodide repository it will be loaded from PyPi.

Parameters

requirements (str | List[str]) –

A requirement or list of requirements to install. Each requirement is a string, which should be either a package name or URL to a wheel:

  • If the requirement ends in .whl it will be interpreted as a URL. The file must be a wheel named in compliance with the PEP 427 naming convention.

  • If the requirement does not end in .whl, it will interpreted as the name of a package. A package by this name must either be present in the Pyodide repository at indexURL <globalThis.loadPyodide> or on PyPi

Returns

A Future that resolves to None when all packages have been downloaded and installed.

Return type

Future