Jan-Hendrik Müller
Jan-Hendrik Müller
Explore posts from servers
Mmarimo
Created by Jan-Hendrik Müller on 11/15/2024 in #help-support
current working directory when python file in subfolder
my current workaround:
cd subfolder
uv run marimo edit hello.py
cd subfolder
uv run marimo edit hello.py
4 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
Can we use global marimo with a custom venv?
I'm really interested in that question as well!
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
Finally, I can also run marimo in a project with uv like this:
uv init (this will create a pyproject.toml file)
uv add marimo (this will add "marimo>=0.9.9" to dependencies in pyproject.toml)
uv run marimo edit hi.py
uv init (this will create a pyproject.toml file)
uv add marimo (this will add "marimo>=0.9.9" to dependencies in pyproject.toml)
uv run marimo edit hi.py
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
Awesome! Figuring out all this packaging stuff is like walking through fog, exploring and never knowing if you will reach the destiny. But on the path I think I figured out some best practices that I'll use now when working with marimo, that I'll share right here. 1. I'll have a global version of marimo installed via uv tool install marimo or with a specific python version using UV_PYTHON=python3.11 uv tool install marimo (this will overwrite the previous global installation) Furthermore, the global version of marimo can be updated via uv tool install marimo --upgrade. When I run a script with the global marimo version, I'll do that via marimo edit hi.py --sandbox When I run a script that already ran once with a --sandbox flag, I can simply omit this flag and run marimo edit hi.py The CLI tell me "This notebook has inlined package dependencies. Run in a sandboxed venv containing this notebook's dependencies? [Y/n]" and I'll press "Enter" to continue Now, when I don't want to use the global marimo, but a temporary marimo version instead, I'll run uvx marimo edit --sandbox hi.py this line is 100% identical to uv tool run marimo edit --sandbox hi.py because "uvx" is an alias to "uv tool run". I can also specify a python version here, like this uvx --python 3.13 marimo edit hi.py The thing about uvx marimo is the following: It's not installed, it's just cached. Runing uv cache clean will remove all artifacts from my system that were cached with uvx before. Another option is to work with a virtual environment using uv:
uv venv
uv pip install marimo
uv run marimo edit hi.py
uv venv
uv pip install marimo
uv run marimo edit hi.py
this venv can also be activated via source .venv/bin/activate and then marimo can be started via marimo edit hi.py . And always, if I'm not sure what marimo installation I'm currently using, I can run which marimo and it will show me the file path.
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
Awesome! But that I can also do with uvx --python 3.13 marimo edit hi.py , wich is maybe a bit cleaner. But is
uvx --python 3.13 marimo edit hi.py
and
UV_PYTHON=python3.13 uvx marimo edit hi.py
uvx --python 3.13 marimo edit hi.py
and
UV_PYTHON=python3.13 uvx marimo edit hi.py
100% identical?
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
No description
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
Thanks for rephrasing, but I think I still don't understand the idea
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
Can you specific this with an environment variable?
II dont understand, can you explain this a bit more?
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
I see! So in theory, the --python 3.11 flag could be called as well in that context?
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
(second cross-post of the answer)
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
No description
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
No description
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
No description
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
No description
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
No description
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
and e.g. when I now want to use python 3.11, would that be also possible?
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
just pasting the screenshot for documentation reasons, so that other members/LLMS can see the whole process.
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
No description
51 replies
Mmarimo
Created by Jan-Hendrik Müller on 10/11/2024 in #help-support
marimo+uv workflow
yep, it's uv tool update-shell
51 replies