Micropip API

micropip.install(requirements: Union[str, List[str]], keep_going: bool = False)

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.

When used in web browsers, downloads from PyPI will be cached. When run in Node.js, packages are currently not cached, and will be re-downloaded each time micropip.install is run.

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

  • keep_going (bool, default: False) –

    This parameter decides the behavior of the micropip when it encounters a Python package without a pure Python wheel while doing dependency resolution:

    • If False, an error will be raised on first package with a missing wheel.

    • If True, the micropip will keep going after the first error, and report a list of errors at the end.

Returns

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

Return type

Future

micropip.install(requirements: Union[str, List[str]], keep_going: bool = False)

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.

When used in web browsers, downloads from PyPI will be cached. When run in Node.js, packages are currently not cached, and will be re-downloaded each time micropip.install is run.

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

  • keep_going (bool, default: False) –

    This parameter decides the behavior of the micropip when it encounters a Python package without a pure Python wheel while doing dependency resolution:

    • If False, an error will be raised on first package with a missing wheel.

    • If True, the micropip will keep going after the first error, and report a list of errors at the end.

Returns

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

Return type

Future