Daniel Ashbrook
Daniel Ashbrook2mo ago

Installing specific package versions

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.
Solution:
@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...
Jump to solution
3 Replies
Akshay
Akshay2mo ago
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
Daniel Ashbrook
Daniel AshbrookOP2mo ago
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.
Solution
Myles Scolnick
Myles Scolnick2mo ago
@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