{"id":2991,"library":"marimo","title":"marimo Reactive Python Notebook","description":"marimo is an open-source reactive Python notebook library that enhances traditional notebooks by guaranteeing consistency between code and outputs. It stores notebooks as pure Python files, making them Git-friendly, executable as standalone scripts, and deployable as interactive web applications. marimo also provides built-in UI elements and first-class SQL support. The current version is 0.23.1, and the project has an active development and release cadence.","status":"active","version":"0.23.1","language":"en","source_language":"en","source_url":"https://github.com/marimo-team/marimo","tags":["notebook","reactive","data science","web app","UI","SQL","python"],"install":[{"cmd":"pip install marimo","lang":"bash","label":"Base Installation"},{"cmd":"pip install \"marimo[sql]\"","lang":"bash","label":"With SQL (e.g., DuckDB) and other extras"}],"dependencies":[{"reason":"Powers the command-line interface.","package":"click","optional":false},{"reason":"ASGI framework for web server.","package":"starlette","optional":false},{"reason":"ASGI server for running notebooks as web apps.","package":"uvicorn","optional":false},{"reason":"Used for real-time communication in the notebook.","package":"websockets","optional":false},{"reason":"High-performance serialization library.","package":"msgspec","optional":false},{"reason":"Provides SQL capabilities (part of `marimo[sql]`).","package":"duckdb","optional":true},{"reason":"High-performance DataFrame library (often used with `marimo[sql]`).","package":"polars","optional":true},{"reason":"Declarative statistical visualization library (for interactive plotting).","package":"altair","optional":true}],"imports":[{"note":"marimo explicitly disallows `import *` to maintain a clear dependency graph and avoid ambiguity.","wrong":"from marimo import *","symbol":"marimo","correct":"import marimo as mo"},{"note":"UI elements are accessed through the `mo.ui` submodule.","symbol":"ui elements","correct":"mo.ui.slider(...)\nmo.ui.dropdown(...)"}],"quickstart":{"code":"import marimo as mo\n\n# Create an interactive slider\nslider = mo.ui.slider(1, 100, value=50, label=\"Select a value\")\nslider\n\n# A reactive cell that uses the slider's value\n# This cell will automatically re-run when the slider moves.\nmo.md(f\"The current value is **{slider.value}**\")\n","lang":"python","description":"This quickstart demonstrates creating a simple reactive marimo notebook. Save this code as a `.py` file (e.g., `my_notebook.py`) and run `marimo edit my_notebook.py` in your terminal to open it in your browser. The second cell will automatically update as you interact with the slider in the first cell."},"warnings":[{"fix":"Avoid in-place mutations of objects across cell boundaries. Instead, reassign variables to new objects, or ensure all operations on a specific object occur within the same cell that defines it.","message":"marimo's reactive model does not track mutations to objects across cells. If you modify an object in one cell and expect another dependent cell to react to that mutation, it will not work as expected. Instead, create new objects or perform all mutations within a single cell to ensure reactivity.","severity":"breaking","affected_versions":"All versions"},{"fix":"Refactor your code to ensure each variable is assigned a value in only one cell. Use local variables or pass values between cells explicitly.","message":"Each variable can be defined in only one cell to ensure a clear and reproducible execution order. Defining the same variable in multiple cells will result in an error.","severity":"breaking","affected_versions":"All versions"},{"fix":"Use explicit imports (e.g., `import marimo as mo` or `from marimo.ui import slider`) instead of wildcard imports.","message":"marimo does not allow `import *` (importing all symbols from a library) to prevent ambiguity and maintain a well-defined dependency graph.","severity":"breaking","affected_versions":"All versions"},{"fix":"Analyze your cell dependencies and refactor your code to break any circular references. This typically involves rethinking data flow and variable assignments.","message":"Circular dependencies between cells are not allowed. If Cell A depends on Cell B, Cell B cannot simultaneously depend on Cell A. This prevents infinite loops and ensures a deterministic execution flow.","severity":"breaking","affected_versions":"All versions"},{"fix":"Isolate UI element definitions in cells that do not have upstream dependencies that would cause them to re-execute unnecessarily. Use `mo.state` for persistent, mutable state across reruns if an element's value needs to survive cell re-execution without resetting.","message":"UI elements (e.g., `mo.ui.slider`) will reset to their initial `value` argument if the cell defining them reruns. This can happen if the cell itself depends on other changing variables.","severity":"gotcha","affected_versions":"All versions"},{"fix":"To share notebooks with rendered outputs on GitHub, configure marimo to automatically snapshot outputs to an `.ipynb` file or use services like molab for live previews.","message":"marimo notebooks are pure Python files (`.py`), which means GitHub does not render their outputs directly like Jupyter's `.ipynb` files.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}