By default, quarto-marimo creates a sandboxed Python environment with uv. To add a package for one document, declare it in the document frontmatter under pyproject.
After that, you can import the package normally inside marimo cells. If the package exposes an anywidget, wrap it with mo.ui.anywidget so marimo can keep the UI reactive in Quarto output.
Example: wigglystuff.Slider2D
import%20marimo%20as%20mo%0Afrom%20wigglystuff%20import%20Slider2D%0A%0Awidget%20%3D%20mo.ui.anywidget(%0A%20%20%20%20Slider2D(%0A%20%20%20%20%20%20%20%20width%3D320%2C%0A%20%20%20%20%20%20%20%20height%3D320%2C%0A%20%20%20%20%20%20%20%20x_bounds%3D(-2.0%2C%202.0)%2C%0A%20%20%20%20%20%20%20%20y_bounds%3D(-1.0%2C%201.5)%2C%0A%20%20%20%20)%0A)%0A%0Awidgetmo.callout(%0A%20%20%20%20f%22x%20%3D%20%7Bwidget.x%3A.3f%7D%2C%20y%20%3D%20%7Bwidget.y%3A.3f%7D%3B%20bounds%20%7Bwidget.x_bounds%7D%20%2F%20%7Bwidget.y_bounds%7D%22%0A) Back to top
---title: External dependenciesheader: |- # Copyright 2026 Marimo. All rights reservedpyproject: | requires-python = ">=3.11" dependencies = [ "marimo>=0.23.1", "wigglystuff", ]---# External dependenciesBy default, `quarto-marimo` creates a sandboxed Python environment with `uv`.To add a package for one document, declare it in the document frontmatterunder `pyproject`.```yaml---pyproject: | requires-python = ">=3.11" dependencies = [ "marimo>=0.23.1", "wigglystuff", ]---```After that, you can import the package normally inside marimo cells. If thepackage exposes an anywidget, wrap it with `mo.ui.anywidget` so marimocan keep the UI reactive in Quarto output.## Example: `wigglystuff.Slider2D````{python .marimo}import marimo as mofrom wigglystuff import Slider2Dwidget = mo.ui.anywidget( Slider2D( width=320, height=320, x_bounds=(-2.0, 2.0), y_bounds=(-1.0, 1.5), ))widget``````{python .marimo}mo.callout(f"x = {widget.x:.3f}, y = {widget.y:.3f}; bounds {widget.x_bounds} / {widget.y_bounds}")```