Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: pin version to current marimo version in sandbox (#2447)

Myles Scolnick85cda02a3473
diff --git a/marimo/_cli/sandbox.py b/marimo/_cli/sandbox.py
index 629869559f..879d4f8488 100644
--- a/marimo/_cli/sandbox.py
+++ b/marimo/_cli/sandbox.py
@@ -12,7 +12,7 @@ from typing import Any, Dict, List, Optional, cast
import click
-from marimo import _loggers
+from marimo import __version__, _loggers
from marimo._cli.file_path import FileContentReader
from marimo._cli.print import bold, echo, green
from marimo._config.settings import GLOBAL_SETTINGS
@@ -128,6 +128,16 @@ def run_in_sandbox(
if "marimo" not in dependencies:
dependencies.append("marimo")
+ # Rename marimo to marimo=={__version__}
+ index_of_marimo = dependencies.index("marimo")
+ if index_of_marimo != -1:
+ dependencies[index_of_marimo] = f"marimo=={__version__}"
+
+ # During development, you can comment this out to install an
+ # editable version of marimo assuming you are in the marimo directory
+ # DO NOT COMMIT THIS WHEN SUBMITTING PRs
+ # dependencies[index_of_marimo] = "-e .[dev]"
+
with tempfile.NamedTemporaryFile(
mode="w", delete=False, suffix=".txt"
) as temp_file: