Get help from the marimo community

Updated 2 months ago

Installing specific package versions

At a glance

The community member is interested in creating a Marimo sandbox and installing the webcolors package, but wants to know how to import a specific version. Another community member suggests using uv add --script notebook.py webcolors==1.12 to specify the version, but notes that this requires restarting the notebook, which could be inconvenient for long-running projects.

In response, a third community member mentions that Marimo has recently added the ability to install packages by version, e.g. pandas==2.0.0, and that if the package is already installed, it will be re-installed at the requested version. This feature will be released soon.

Useful resources
It's super cool that I can make a Marimo sandbox and then do import webcolors and get it installed! But how can I import a specific version? E.g., with pip I'd do pip install webcolors==1.12.
A
D
M
3 comments
That’s a good point. We don’t support that yet from the notebook UI, but we can look into it.

In the meantime you could use uv directly to specify the package and version: uv add --script notebook.py webcolors==1.12
Ok, that works, but then I have to restart the notebook to get it installed (as far as I can tell…), which is ok for tiny projects but would get annoying for times when something long-running has to be re-run.
@Daniel Ashbrook - we just added this https://github.com/marimo-team/marimo/pull/2392 (will be released soon).

you can now install a package by version pandas==2.0.0 .
if a the package already installed, it will re-install at the requested version.
if you are using --sandbox, it will be added with at that version to your inline-script metadata
Add a reply
Sign up and join the conversation on Discord