Python Packages

import micropip
# `await` is necessary to halt execution until the package is available
await micropip.install("faker")
# import installed package
from faker import Faker
# use the package!
fake = Faker()
Install the given package and all of its dependencies.
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. Learn more about how packages work in Pyodide.