svg.py
. This can be installed using uv add svg.py
. To import it, you use from svg import SVG
instead of from svg.py import SVG
. I think this is why the error below happens.#!/bin/bash files=("batch_and_form.py" "data_explorer.py") source .venv/bin/activate for file in "${files[@]}"; do without_extension="${file%.*}" uv run marimo export html-wasm "$file" -o public/"$without_extension".html --mode run done deactivate
git push
with the following .gitlab-ci.yml
:pages: script: - echo "Deploying to GitLab Pages..." artifacts: paths: - ./public only: - main
Traceback (most recent call last): File "/lib/python3.12/site-packages/marimo/_runtime/executor.py", line 141, in execute_cell exec(cell.body, glbls) Cell marimo://notebook.py#cell=cell-0, line 3, in <module> from svg import SVG, G, Circle, PathModuleNotFoundError: No module named 'svg'
svg
module, even though it is in the requirements.txt
as svg-py
. Another page that uses D3 has no issues.import micropip await micropip.install('svg-py')
svg-py was not installed: micropip is only available in WASM notebooks.
if run locally.[mo.ui.anywidget(my_widget1),mo.ui.anywidget(widget2)]
) and "collapse" the array in marimo, they may or may not reappear when I expand that array again. They will reappear when I restart the kernel. Could this be a general stability issue?uv
).uv pip install -U marimo
pyproject.toml
, uv.lock
and at the top of the notebook itself in __generated_with
. Can the issue be reopened?widget_instance = MyWidget(in_value=7)
where m.widget.out_value
would not change). Thank you so much for following up on this.mo.hstack([mo.ui.anywidget(brushable_sepals),mo.ui.anywidget(brushable_petals)], justify="start")
.// Things to do ONLY ONCE if (!svg) { parser = new DOMParser();
svg
is already set when the widget goes from hidden to not hidden. i would try to avoid global state, or try to check another way if the svg is already set (i.e. like checking the dom)brushable_sepals.observe(lambda x: set_selected(x["new"]), names="selected_ids") brushable_petals.observe(lambda x: set_selected(x["new"]), names="selected_ids")
selected_ids
in the other plot to update anymore.class CounterWidget(anywidget.AnyWidget): _esm = """ function render({ model, el }) { let count = () => model.get("value"); let btn = document.createElement("button"); btn.innerHTML = `count is ${count()}`; btn.addEventListener("click", () => { model.set("value", count() + 1); model.save_changes(); }); model.on("change:value", () => { btn.innerHTML = `count is ${count()}`; }); el.appendChild(btn); } export default { render }; """ value = traitlets.Int(123).tag(sync=True)
get_value, set_value = mo.state(456)
cw1 = CounterWidget() cw2 = CounterWidget()
cw1.observe(lambda x: set_value(x["new"]), names="value") cw2.observe(lambda x: set_value(x["new"]), names="value")
aw1 = mo.ui.anywidget(cw1) aw2 = mo.ui.anywidget(cw2) aw1
aw1.widget.value
aw1
widget.aw2.widget.value
123
and does not change when the value of aw1.widget.value
changes, even though it should given the observe
in cell 4.