Skip to content

Conversation

@dmadisetti
Copy link
Collaborator

@dmadisetti dmadisetti commented Jan 14, 2026

Introduces [tool.marimo.venv].path configuration option that allows users to specify a custom virtual environment for sandbox multi mode. This enables using predefined environments (conda, poetry, custom venvs) instead of ephemeral sandboxes.

Configuration

In your notebook's script metadata or pyproject.toml:

[tool.marimo.venv]
path = "path/to/venv"      # relative or absolute path
writable = true            # optional: allow marimo to install deps (default: false)

Behavior

editable marimo installed? Action
true - Installs marimo + IPC deps (pyzmq) into the venv
false Yes Uses venv as-is, warns if version mismatch
false No Injects PYTHONPATH for marimo (requires matching Python version)

Additionally, has some handling / logic for incompatible venvs:

image

Error Handling

  • Invalid venv path: Clear error message if venv doesn't exist or has no Python interpreter
  • Python version mismatch: When editable=false and marimo isn't installed, checks that venv Python matches server Python (required for binary deps like msgspec, pyzmq)
  • Version mismatch warning: Logs warning if venv's marimo version differs from current

Supercedes #7624

@vercel
Copy link

vercel bot commented Jan 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
marimo-docs Ready Ready Preview, Comment Jan 14, 2026 9:22pm
@dmadisetti dmadisetti added internal A refactor or improvement that is not user facing enhancement New feature or request and removed internal A refactor or improvement that is not user facing labels Jan 14, 2026
@dmadisetti dmadisetti changed the title feat: add [toolmarimo.env.venv] to specify a specific venv Jan 14, 2026
# Check Python version compatibility for binary deps
if not check_python_version_compatibility(venv_python):
raise KernelStartupError(
f"Configured venv uses a different Python version than marimo.\n"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds like ephemeral sandboxes can use different Python versions than the server process, but configured venv's can't. Is that correct, and if so why the asymmetry?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if the new comments address this

@dmadisetti dmadisetti changed the title feat: add [tool.marimo.env].venv to specify a specific venv Jan 14, 2026
@github-actions github-actions bot added the bash-focus Area to focus on during release bug bash label Jan 14, 2026
mscolnick
mscolnick previously approved these changes Jan 14, 2026
@mscolnick mscolnick merged commit 3380803 into main Jan 15, 2026
65 of 73 checks passed
@mscolnick mscolnick deleted the dm/venv-conf branch January 15, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bash-focus Area to focus on during release bug bash enhancement New feature or request

4 participants