Location via proxy:   
[Report a bug]   [Manage cookies]                

Get help from the marimo community

Hi, has anyone managed to use marimo on ssh using tailscale ? When running the marimo edit --headless in cmd on remote, I try opening the links in my local browser while tailscale is activated (and working well since I am connected to the remote and running commands), the webpage is just not loading at all.
I guess I'm missing something as I don't have the best understanding of how running the notebook over ssh would work. I was hoping it could work over the vscode extension since running ssh in vscode is user friendly, but I just can't get to load any marimo notebook through the vscode extension as mentioned in this issue https://github.com/marimo-team/vscode-marimo/issues/61.
2 comments
M
a
Is it a known issue somewhere that I'm not seeing here or on Github where a Markdown cell doesn't stay a Markdown cell after saving and shutting down a notebook in an edit server?
6 comments
d
R
I would love to embed Marimo snippets in my educational content created with Docusaurus. I use MDX files (markdown that contains react components for quizzes and the like) and they do not support plain HTML so no div and marimo-iframe tags. I could create a React component that embeds marimo via an iframe, but I do not get it to resize automatically and I also enjoy embedding the python code directly. Any ideas?
13 comments
d
t
S
J
My company builds streaming database https://github.com/timeplus-io/proton I'd like to enable auto-refresh for the notebook to load new data every X seconds. I tried the mo.ui.refresh( label="Refresh", options=["1s", "5s", "10s", "30s"]) but it doesn't refresh the cells below. Is this a bug? I may try other approaches, such as cell.run() but it will be easier if the the refresh widget/button just work
14 comments
J
M
S
This happens (seemingly) for no reason. I've attached a screenshot and logs from my running container since it's too lengthy for a message here.

Plain Text
  File "/home/app_user/venv/lib/python3.13/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self.scope, self.receive, self.send
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/home/app_user/venv/lib/python3.13/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/app_user/venv/lib/python3.13/site-packages/starlette/applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/app_user/venv/lib/python3.13/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/home/app_user/venv/lib/python3.13/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/home/app_user/venv/lib/python3.13/site-packages/marimo/_server/api/auth.py", line 220, in __call__
    return await super().__call__(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/app_user/venv/lib/python3.13/site-packages/starlette/middleware/sessions.py", line 85, in __call__
    await self.app(scope, receive, send_wrapper)
  File "/home/app_user/venv/lib/python3.13/site-packages/starlette/middleware/base.py", line 173, in __call__
    with recv_stream, send_stream, collapse_excgroups():
                                   ~~~~~~~~~~~~~~~~~~^^
  File "/usr/local/lib/python3.13/contextlib.py", line 162, in __exit__
    self.gen.throw(value)
    ~~~~~~~~~~~~~~^^^^^^^
  File "/home/app_user/venv/lib/python3.13/site-packages/starlette/_utils.py", line 82, in collapse_excgroups
    raise exc
3 comments
A
R
Hi everyone, I have started working some months ago on a marimo file for municipal energy planning as part of a project in my consulting company.

This project has been growing bigger as other clients are becoming interested in the methodology and outputs.

I’m curious to know how best to onboard a new colleague with some clean documentation of the code. I know that some other colleagues of mine which work with more standard python files use mostly docstrings to stick as much as possible to the source code.

What are the best practices to do something similar in marimo ? Do you have any recommendations ?

Thanks for the help !
1 comment
e
I'm not seeing this in the docs or config file defaults.
5 comments
M
R
1) Is there a way to push styling to the iframe itself when using https://docs.marimo.io/api/html/#marimo.iframe ? Even setting the height to a fixed value, there is still a style=height: 88px that is being appended and changing the displayed height

2) Is there a way to hide a section of code within a cell on load? We have a large function that makes sense to collapse the cell with the code line number arrow, but we want this as the default for people as they load up the notebook.
I currently subscribe for ChatLLM from Abacus AI which gives me access to ChatGPT, Claude, Gemini and so on. However, I can't find a way to connect it to the marimo notebook AI completion. Is it possible at the moment or do I need to subscribe to one of the specific providers?

I didn't find a way to get an API key from abacus AI.
3 comments
S
M
So I am having a BLAST with mo.ui.dataframe, can't tell you how much I LOVE this component. One thing I would be interested in is having an area where the users can select columns from the current results and use them to create a new dataframe where they perform rudimentary polars operations to create new columns. A simple scratchpad for them to test out their ideas.
I have installed the marimo using the command of

pip install marimo

succsefully, but when I check it using

marimo tutorial intro

It cannot work
7 comments
S
Z
Pretty sure it is the same problem from a few weeks ago, not sure if it ever went away then came back or if I just didn't run in a way that triggered it...

When I run each cell at a time it works with no problems, but if it tries to Run All Stale Cells it appears to be getting stuck in an infinite loop or something
(such as when starting up with the default settings)

Reproducing it: just marimo edit --sandbox polars/05_reactive_plots.py then Run All, repository: https://github.com/etrotta/marimo-learn/blob/main/polars/05_reactive_plots.py
Tested on the latest marimo version from pypi
1 comment
e
Hi everyone! Looking for some help / examples of how to think about and manage circular dependencies of cells / objects.

The most pressing use case is building a reactive dashboard for data exploration and labeling. We want to be able to see distributions of various categories in the data set and how they interact with each other. And also see some examples. This is a super common use case for us (and I'm sure others) and so I'm now trying to generalize the approach to create somewhat of a template. We've found really nice success with sharing with our clients for fast iteration and feedback on our longer term deliverables.

Current State:
  • We have N charts and each chart is created using the full data set and the count of objects that match each bar's category.
  • We have a table underneath showing rows that match the active selection
  • When clicking any of the bars, the table data will filter to the rows that match the selected bar's category for the bar's corresponding column
    ** It does this for all charts (as we want)
  • (We also have some markdown to display example rows and a small labeling tool in there too)
Problem: All of the charts are independent of one another. The ideal scenario is that one chart is clicked, the other charts will change to filter the data in which they were created for all the active selections (except their own). (This is called faceted search/filtering and is super common in search applications -- like on any e-retailer site).
  • We have functions that will do these calculations and that's not an issue--the issue is creating some sort of object that will "listen" for the charts to be clicked, run the filtering functions, and then update the other charts. But then there is a circular dependency.
11 comments
Z
e
A
Is there any built-in mechanism to retain the state of input elements upon refreshing?
2 comments
l
S
When I use this invocation to edit a marimo notebook for the first time, it asks me interactively to install missing python packages as they are needed, and writes dependency comments at the top of the main.py.
However, when I come back later to edit the same file with the same invocation, I get the interactive prompts to install packages again.
Is that how it's supposed to work?
6 comments
M
R
s
Hey everybody,

I have started using Marimo recently and became a big fan.

Previously I have used getpass in Jupyter Notebooks to get user credentials to then use them to authenticate with Trino.

When I use getpass.getpass() in a marimo notebook it displays the provided password during the entire session. Is there any known alternative or workaround to that?

Thanks!
4 comments
M
N
Is there a way to do this? I help run a shared cluster and we'd like to offer Marimo as an interactive app via Open OnDemand. This would mean it's all in the browser, there's no command line. If I start out with marimo tutorial intro , is there a way, from within the browser only, to open an existing notebook or create a new one? We currently offer jupyterlab and it has this ability but I wasn't able to figure this out in marimo. If not, please consider this a feature request.

ETA: I could start with marimo edit which gives me a blank notebook, but from there I don't see a way to open an existing notebook in the browser.
2 comments
S
d
I often get invalid date in the dataframe explorer which always concerns me but then I realise the date is correct, I don't know if others have seen this much.

In my case I am using polars and turning a date string to a date object with a line like:

pl.col('datum').str.to_date("%m/%d/%y %H:%M")
2 comments
M
l
I couldn't think of another way to make a Pyplot diagram change other than with a state variable.

Here was my attempt:

Plain Text
import marimo as mo
import matplotlib.pyplot as plt
import numpy as np

In the following cells, the quick idea is: Make three vertices with labels "A", "B", "C", and a button that when clicked, will rotate the labels 120 degrees.
Plain Text
get_rot, set_rot = mo.state(0)
def rot_btn_func(getter, setter):
    setter((getter() + 1) % 3)

rotate = mo.ui.run_button(label="Rotate", on_change=rot_btn_func(get_rot, set_rot))


Plain Text
r = 10
fig, ax = plt.subplots()
ax.set_xlim(-20, 20)
ax.set_ylim(-5, 25)
ax.set_aspect('equal')
v1 = plt.Circle((-r, 0), 2, color="blue", fill=True, alpha=0.5)
v2 = plt.Circle((r, 0), 2, color="blue", fill=True, alpha=0.5)
v3 = plt.Circle((0, 1.7*r), 2, color="blue", fill=True, alpha=0.5)
ax.add_patch(v1)
ax.add_patch(v2)
ax.add_patch(v3)

locs = [(0,2*r), (-r-5,0), (r+5,0)]
locs = locs[get_rot():] + locs[:get_rot()]
aloc = locs[0]
bloc = locs[1]
cloc = locs[2]

plt.rcParams['text.usetex'] = True
ax.text(*aloc, r"A")
ax.text(*bloc, "B")
ax.text(*cloc, "C")

if get_rot() == 0:
    rotstring = "Rotation by 0 degrees"
if get_rot() == 1:
    rotstring = "Rotation by 120 degrees"
if get_rot() == 2:
    rotstring = "Rotation by 240 degrees"

ax.text(5,20, rotstring)

ax


I'm just guessing at how to pass arguments to the on_change function, and probably guessing wrong. Does anyone know how it should be done?

I can't make the function with no arguments since, then, the arguments need to be global in order for the function to reference them. And as far as I can tell, it's not possible to declare these variables global.
I think it would be very useful if the file explorer inside Marimo indicates which Marimo document you have currently opened. Sometimes if you are working with several docs, you get a bit loose on which one you are in the file explorer.
How can I get the value of an element in another cell, without triggering that cell when I change the value of said element? Say I have a number element defined in cell 1, and in cell 2 I want to read the value, when I click a button. If I mention the "number" element in cell2, it will immediately trigger a refresh of cell 2 when I update the value of cell 1.
3 comments
S
j
b
banihas
·

Minimap

Is there a minimap feature in marimo?
1 comment
M
Is it possible to change the MAX_OUTPUT_SIZE from within a running notebook? I tried to change the env var from within the notebook and it didn't work.

I was wondering if alternatively to it it's possible to catch the MAX_OUTPUT_SIZE warning before it happens and changing the warning or default behaviour? In my use case I want to catch it and offer the user to download the output as a file if the output is too big
3 comments
A
l
still not having any luck loading local files using a web assembly link I send via email to a machine ( puppy NOT MY NAMING!!!) . It's not finding a file that exists using https://docs.marimo.io/api/miscellaneous/#marimo.notebook_dir can some check out where I am going wrong please?

the file exists

Plain Text
puppy@pupx1:~$ ls -l /home/puppy/Desktop/tontine_2025/data/results/10_results.csv
-rw-rw-r-- 1 puppy puppy 138140697 Mar 31 09:00 /home/puppy/Desktop/tontine_2025/data/results/10_results.csv


the code


Plain Text
import marimo as mo
import polars as pl

paths = [
    "/home/puppy/Desktop/tontine_2025/data/results/",
    "/media/dave/DT_8_TB/t25/mega",
    "/Users/fangster/Desktop/Tontine_2025/data"
]

file_name = "10_results.csv"

for path in paths:
    file_path =  mo.notebook_dir() / path / file_name
    print(path)
    print(file_name)
    print(file_path)
    if file_path.exists():
        print(f"File found at: {file_path}")
        break
else:
    print("File not found in any of the specified paths.")


and the out put

Plain Text
/home/puppy/Desktop/tontine_2025/data/results/
10_results.csv
/home/puppy/Desktop/tontine_2025/data/results/10_results.csv
/media/dave/DT_8_TB/t25/mega
10_results.csv
/media/dave/DT_8_TB/t25/mega/10_results.csv
 File not found in any of the specified paths.
12 comments
M
j