marimo

M

marimo

Join the community to ask questions about marimo and get answers from other members.

Join

help-support

archived-help-and-support

Google Tag Manager on Marimo

To install GTM on a webpage, the following code needs to be injected just under <head> <!-- Google Tag Manager --> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],...

"kernel not found" when port forwarding

Hi! My labmates and I have created a Marimo notebook to accompany our paper. We are trying to deploy the notebook to AWS, but are facing some networking issues. I would like to be able to go to port 80 so that users don't have to specify a port number in their URL. I.e., the following link should work: http://ec2-3-19-54-159.us-east-2.compute.amazonaws.com/ However, it currently gives the error "kernel not found". I know the marimo notebook works because when I specify the port number directly I can access the notebook without issue: http://ec2-3-19-54-159.us-east-2.compute.amazonaws.com:8080/...
No description

Setting options when running programatically

Hello, how can I set config when running marimo programmatically? I've tried a bunch of stuff but nothing works. The corresponding .marimo.toml entry would look like this:...

Network visualization (ex: ipysigma) within marimo

Hi ! I am trying to make an app with a graph view to visualize and interract with networks. I can plot static networks without pb with plotly or altair, but cannot integrate interactive libraries. Has anyone tried https://github.com/medialab/ipysigma or https://pyvis.readthedocs.io/en/latest/index.html in marimo ?...

Disable fancy dataframe editor?

Ciao, how can I disable the fancy dataframe viewer? I am getting an error (will report later) but right now I need to work on this 🙌
Solution:
mo.plain(df)
No description

Programmatic way to detect theme (light/dark mode)?

I reckon this might not be possible, since theme appears to be a frontend property, but is there a way to detect whether the app is displayed in light/dark mode from the python side?
Solution:

Embedded VSCode browser issue

Hi, I'm trying to get the VSCode embedded browser for marimo notebooks to launch, but it works on one of my computers and not my other one. It seems to work on my Windows 10 machine, but not on Windows 11. I don't have readily available access to another Windows machine to test on. On both machines, I have marimo 0.7.6 and the marimo VSCode extension v 0.4.1. I tell VSCode to launch a marimo notebook py file in edit mode. On Win 10, it launches and loads the VSCode embedded browser on the side, whereas on Win 11, it does not (the localhost:2718 is in the terminal in VSCode, but seems to still be running on Win 11 - I need to press Ctrl-C to end the process, whereas on Win 10 it seems like it completes and there is a new line ready for me to run another terminal command). Is this a known issue and, if so, are there any solutions? I am running Marimo 0.7.6 on both machines with the marimo VSCode extension v 0.4.1. Any ideas on next things to try would be appreciated....

Play MIDI files through `mo.audio()`

Hi, I'd like to try out marimo to compose music, but I can't play midi files. For instance,
mo.audio(src="https://bitmidi.com/uploads/79828.mid")
mo.audio(src="https://bitmidi.com/uploads/79828.mid")
...
Solution:
Wow, magic!!! Thanks++! Edit: the code with mo.state. ```...

Recommended way for self-triggering computation / semi-infinite loop?

Is there a recommended way to trigger a cell (which mutates state) to re-run after it's done -- under some conditions? I was under the impression the following combination of switch/stop would do the trick, but it doesn't seem to be able to escape the infinite loop? ```python...

Marimo Edit not working after upgrading

After upgrading to version 7.3, the latest version, I get this error in the terminal, and the home page doesn't open at all. PermissionError: [WinError 5] Access is denied: 'C:\Users\mustj\AppData\Local\Application Data'...
No description

Invalid Session for create_asgi_app deployed across 4 different machines

File "/bb/libexec/workflow-metrics-notebooks/python/lib/python3.10/site-packages/marimo/_server/api/deps.py", line 135, in require_current_session
raise ValueError(f"Invalid session id: {session_id}")
ValueError: Invalid session id: s_p41hf3
File "/bb/libexec/workflow-metrics-notebooks/python/lib/python3.10/site-packages/marimo/_server/api/deps.py", line 135, in require_current_session
raise ValueError(f"Invalid session id: {session_id}")
ValueError: Invalid session id: s_p41hf3
...

"Generate with AI" fails / vLLM OpenAI compatible server

I am using vLLM to serve a local LLM using the vLLM OpenAI compatible server. I can set the URL, API key, and the Model successfully in the marimo Settings pane. When I hit "generate", marimo sees the server but the call violates a requirement for the chat role to alternate between "assistant" and "user". ```...

dataframe corresponding to brushed segment of a plotly scatterplot

This is more of a python question, but is there a way to return dataframe corresponding to brushed segment of a plotly scatterplot? Similar to altair. - @Mustjaab...
Solution:
@Mustjaab , you should be able to do something like ```python import plotly.express as px import marimo as mo...

support ruff configuration in `pyproject.toml`? also option to choose b/w ruff and black

first, thanks for creating marimo, i'm having fun developing with it. however, i can't seem to get my ruff pyproject.toml config to work. might be something with my setup defaulting to black? i can't easily remove black since i installed marimo with conda (through pixi) and black is set as a required dependency. would be useful to be able to manually select between the two....

Have CSVs stick in WASM files

My notebook relies on a few csv files. I found out I could upload then to the WASM version, and it works l as it's in the same "directory" again. However, when I copy/paste the link to another tab to simulate someone else opening the tab, the files disappear. This is for an internal tool, so it's kind of hard to replicate...

Creating a UI component that can update itself

I want to create a batch element, where a drop-down lets the user configure the content of the batch elements, such as having additional features revealed if choosing to do so by the user. For that to work, I need to re-run the cell that generates the batch element. Is there a method to re-run the same cell? I was thinking I could use states to trigger this, but if states are set from the same cell, they dont trigger an update. I couldn't find any documentation about this type of reactivity, as...
Solution:
Yea, use allow_self_loops=True in the mo.state constructor. ```python import marimo ...

Unable to connect to github copilot

Hi - just started using Marimo and it looks pretty nifty! I have been trying to enable github copilot with it but can't seem to. When I select it in the settings, it just says "Unable to connect" and I can't find any debugging info in the repository, or the logs. I am running Marimo on a remote machine with a private IP set to host, might that be the issue?...

Multi-page apps

@penj , continuing the conversation We have some utilities to make multi-page notebooks/apps. - mo.routes with mo.sidebar: https://docs.marimo.io/api/layouts/routes.html...

Deployment

@~Lightfury~ asked: I am going to deploy my marimo project to the anywhere by flask [9:33 AM] but the code is written by fastapi...