Get help from the marimo community

Updated last month

Confused about python version enforcement in sandbox

At a glance

The community member is running a Python script called "zon.py" using the "uv run marimo run --sandbox" command, but is receiving a warning about the "requires-python" value not being found in the workspace. They are confused about this warning, as they have defined a valid "requires-python" attribute in the script.

In the comments, other community members suggest that the warning might be coming from the "uv" tool itself, and that the community member should check if they have a "pyproject.toml" file and add the "requires-python" value there. The community member clarifies that they are running "uv/marimo" in a standalone folder without a "pyproject.toml" file, which is causing confusion about the Python version being used.

The community members also discuss how to best add extra dependencies to a sandboxed notebook, with one suggesting to use "duckdb" instead of "marimo[sql]". Another community member encounters an issue with conflicting "marimo" version requirements when running "uvx marimo edit --sandbox", and a fix is provided in a pull request.

Finally, a community member asks about which "marimo" installation will be used when running "uvx marimo edit --sandbox" with "marimo" as an inline dependency, and the

Useful resources
Plain Text
➜ ~/projects/nbs git:(lcr-mer-772) ✗ VPN ✓
$ head -n 2 zon.py                                                                 16:21:45
# /// script
# requires-python = ">=3.11"
➜ ~/projects/nbs git:(lcr-mer-772) ✗ VPN ✓
$ uv run marimo run --sandbox zon.py                                               16:21:47
warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`.


I am a bit confused at this warning message, I have defined a valid requires-python attribute yet this is happening.

On another front, is it incorrect to use sandboxes the way I am doing it? i.e. using uv run before the marimo call?
M
l
12 comments
this warning might be coming from uv itself and not marimo. do you have a pyproject.toml? you might need to add requires-python
Ah I see, in this case I don't have a pyproject.toml, I'm just running uv/marimo in a standalone folder (I simply have one marimo file with its sandboxed requirements), but it's a bit confusing regarding what python verxion/executable is actually being used in this case
In the same vein of confusion, how is best to add marimo extra dependencies to a sandboxed notebook? Should we just add duckdb rather than marimo[sql]?
Plain Text
➜ ~/nbs git:(lcr-mer-772) ✗ VPN ✓
$ uvx marimo edit --sandbox zon.py                                                                          
Running in a sandbox: uv run --isolated --no-project --with-requirements /var/folders/kt/5fbzpd0j197d08q5bbft193m0000gn/T/tmp_amqiijn.txt --python >=3.11 marimo edit zon.py
  × No solution found when resolving `--with` dependencies:
  ╰─▶ Because you require marimo==0.10.9 and marimo==0.10.12, we can conclude that your requirements are unsatisfiable.
this is a bug on our end. but yea adding duckdb and polars to the top header is recommended for now. ill fix this
That was so quick!! Thanks
I added a comment of a potential edge case
@Myles Scolnick in this case, if I have marimo as an inline dependency and I run uvx marimo edit --sandbox nb.py which marimo installation will uv use? It would be whatever is available to the environment that uv has access to, right? not the one in the sandbox? the user will always need marimo installed in the environment that uv runs prior to running the sandbox?
we will use the marimo version that was used to invoke marimo edit --sandbox
so if you do uvx marimo, uvx might cache what is has download or use the latest if its not found
Ok good to know!!
Add a reply
Sign up and join the conversation on Discord