Skip to content

Dependencies Installation and Imports

Dependencies installation

The micropip package installs dependencies in Pyodide kernel used in JupyterLite notebooks.

For relative imports to work in provided api-examples notebooks, one needs to install the mat3ra-api-examples package in the beginning of the notebook:

import micropip

await micropip.install('mat3ra-api-examples', deps=False)

This will allow relative imports like:

from utils.jupyterlite import get_materials

Listing notebook dependencies in config.yaml

Some of the necessary packages are compiled into pure Python wheels and provided inside the mat3ra-api-examples package. In top-level packages folder. The dependencies for each notebook and default ones are listed in the config.yml file on the top-level.

To install packages required for the notebook, one can use install_packages function from utils.jupyterlite module and provide the name of the notebook and the relative path to the config.yml file:

from utils.jupyterlite import install_packages
await install_packages("create_interface_with_min_strain_zsl.ipynb", "../../config.yml")