diff --git a/marimo/_runtime/runtime.py b/marimo/_runtime/runtime.py index 27030a0ff67..9c204c6771e 100644 --- a/marimo/_runtime/runtime.py +++ b/marimo/_runtime/runtime.py @@ -549,6 +549,13 @@ def _update_runtime_from_user_config(self, config: MarimoConfig) -> None: ): self.package_manager = create_package_manager(package_manager) + if self._should_update_script_metadata(): + # All marimo notebooks depend on the marimo package; if the + # notebook already has marimo as a dependency, or an optional + # dependency group with marimo, such as marimo[sql], this is a + # NOOP. + self._update_script_metadata(["marimo"]) + if ( autoreload_mode == "lazy" or autoreload_mode == "autorun" # Pyodide doesn't support hot module reloading