Get help from the marimo community

I found my code would not generate any plots after upgrading and gave this error:

''scatter' object has no attribue '_render_model'

This was the case for even the basic example from the reference docs:

https://hvplot.holoviz.org/reference/tabular/scatter.html
Plain Text
import hvplot.pandas  

from bokeh.sampledata.iris import flowers as df

df.sample(n=5)

df.hvplot.scatter(x='sepal_length', y='sepal_width', by='species', legend='top', height=400, width=400)


Downgrading to 0.10.5 resolves this for me.
Problem you are facing/What is currently happening:

Currently I am trying to deploy a flask app with a marimo endpoint to a Kubernetes cluster, On localhost the setup and routing works fine.
asgi_app = Starlette(
routes=[
Route("/", endpoint=lambda request: RedirectResponse(url="/api/")),
Mount("/api", app=wsgi_app),
Mount("/", app=marimo_app.build()),
]
)

On the cloud we ran into several permission errors. We are creating a user and gave privileges to /tmp folder, but now encounter the error:
OSError: [Errno 30] Read-only file system: '/home/appuser/.marimo'
However, we do not want to give write privileges to that folder.

What would you expect to happen?
Maybe I do not understand the architecture well enough, but it would be nice to be able to specify a folder where marimo reads and writes the data. Here is some more information/trace

File "/usr/local/lib/python3.12/site-packages/marimo/_server/api/endpoints/ws.py", line 441, in get_session
new_session = mgr.create_session(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/marimo/_server/sessions.py", line 729, in create_session
self.recents.touch(app_file_manager.path)
File "/usr/local/lib/python3.12/site-packages/marimo/_server/recents.py", line 49, in touch
self.config.write_toml(state)
File "/usr/local/lib/python3.12/site-packages/marimo/_utils/config/config.py", line 45, in write_toml
_maybe_create_directory(self.filepath)
File "/usr/local/lib/python3.12/site-packages/marimo/_utils/config/config.py", line 67, in _maybe_create_directory
os.makedirs(marimo_directory)
File "<frozen os>", line 225, in makedirs
OSError: [Errno 30] Read-only file system: '/home/appuser/.marimo'



Is there something I can do to change the directory in which .marimo lies?
2 comments
M
m
making selection on chart results in error if timestamp is used:
unsupported operand type(s) for /: 'str' and 'int'
no error if timestamp column isn't used in encode
16 comments
l
M
while trying to use data explorer with dataframe of DatetimeIndex, looking to do rolling on the DatetimeIndex column, but not seeing the index column in encodings dropdowns
8 comments
e
l
  1. The problem you're facing
Whenever I type something, annoying documentation keeps popping up which is very unhelpful.

  1. What is currently happening
Someone thought it made sense to show live documentation based on text you're typing. So for example when I am typing the word index to declare a simple variable for a loop, I see a popup with documentation for input by the time I've typed in and IndexError when I reach ind. Not only is this terrible UX it's actually also slowing down the UI making the whole thing feel laggy and clunky.

  1. What you expect to happen
I expect this to be removed because to me it makes zero sense to have this feature. What's more baffling is that when I actually am calling a function / method / constructor I don't see any documentation which at least would make some sense. There I need to repeatedly hover over the name to view the documentation.

But assuming completely removing it gets some pushback, likely from whoever came up with this in the first place, maybe at least add a setting to disable it.
3 comments
S
S
M
Is anyone seeing marimo change displaymath text? I type in one thing and it works,then when I re open the file I get another. Happens at least on 0.9.20 and 0.9.21
2 comments
A
b
Not sure if this is a bug, or a feature, but suddenly tables show the datatype below the header of each column. This is also the case on the example in the documentation. Is there a way to disable this?
1 comment
M
Somehow, updating 0.9.14 to 0.9.15 breaks dataframe ui if dataframe is of custom index column, but to_markdown() works for both versions
6 comments
M
l
This morning I updated to Marimo 0.9.15 and now I'm receiving an "Error: Invalid time value" when trying to display an Ibis or a Polars dataframe that contains a timestamp column that is null.

Here's some simple code that replicates what I'm seeing:
Plain Text
df = (
    pl.date_range(date(2001, 1, 1), date(2001, 1, 3), eager=True)
    .alias("date")
    .to_frame()
)
df.with_columns(
    pl.col("date").dt.timestamp().alias("timestamp_us"),
    pl.col("date").dt.timestamp("ms").alias("timestamp_ms"),
    pl.lit(None).cast(pl.Datetime).alias("test")
)
I was having issues with getting Leafmap widgets rendering Choropleth maps to work in Marimo. In this particular example I rendered two Choropleth maps in separate cells which works fine in Jupyter - I converted the notebook to Marimo and initially one of the maps sort of rendered okay - but the moment I tried zooming in the rendered Choropleth polygons got out of sync with the Leaflet map they were overlaying amongst some other text errors before finally the widgets stopped rendering in Marimo altogether.

I can provide the complete notebook if that helps.

I used both from the same conda-forge Python environment with Python 3.12 on Windows and these package versions:

geopandas 1.0.1 pyhd8ed1ab_1 conda-forge
jupyterlab 4.2.5 pyhd8ed1ab_0 conda-forge
leafmap 0.38.16 pyhd8ed1ab_0 conda-forge
marimo 0.9.14 py312h2e8e312_0 conda-forge
pandas 2.2.3 py312h72972c8_1 conda-forge
8 comments
O
M
Hi all! While experimenting with a new notebook on marimo cloud I tried to play with the grid visualization. I got an error at some point and when I hit cmd + . (my bad for not taking a screenshot of the error!) I just got back to my regular source / app view.

I just deleted the layouts directory as I thought it might have contained data that caused the error. After doing that, things stopped working i.e. I get a "Something went wrong" on https://marimo.io/dashboard/projects and cannot seem to be able to see my projects list.

If I directly connect to my notebook's URL I can still load it, see the files list (which I could not access immediately after the error) and the layouts folder still there. Dashboard is still in went wrong mode though, even if I log out/in.

Thanks in advance for any information which might be useful to fix my issue and lmk if there's anything else I can try on my side!
3 comments
M
+
I have got this flowchart:

mo.mermaid(
"""
flowchart TD
B[B]
B --> CC]
C --> D[D]
D --> E[E]
E --> F[F]
F --> G[G]
G --> H[H]

%% Define a class for rounded rectangles with transparent fill
classDef roundedRect fill:transparent, stroke:#333, stroke-width:3px, rx:10, ry:10;

%% Apply the class to all nodes
class A,B,C,D,E,F,G,H roundedRect;
"""
)

which is slightly larger than the output cell. When I use the .center() method, the chart gets smaller to fit in the cell. Is it a desired behavior, or a bug?
4 comments
M
k
Hi team, from time to time shift enter (run and new below) is not working. Not sure what is causing this and how to solve it. On the other hand, ctrl enter works all the time.
9 comments
A
k
M
This is moreso for my understanding of the syntax, but the elements for the unordered list lost their color scheme after I closed the first sub-list
5 comments
M
M
Was "sanboxifying" a notebook with uv (for inline dependency scripts); the notebook just had pyodide as it's main requirement (this is the Post Approval Study Recommender notebook shared by Mustjaab; on clicking the install button (with the popup on the top left), it seemed to fail.

This is whta I got in the terminal:
"ValueError: Pyodide is a Python distribution that runs in the browser or Node.js. It cannot be installed from PyPi. See for how to use Pyodide."

I then added pyodide-py from mairmo's sidebar option to manage packages.
9 comments
H
M
I'm unable to enter any text/type in the mo.ui.chat chatbox area; I can however add default prompts and after they appear in the chatbox text area, I'm able to edit the text. I'm on:
Plain Text
>>> marimo --version
>>> 0.9.7
7 comments
H
A
M
I have a plotly express scatter_mapbox that displays different values (a complete or filtered dataframe) based on the value of a mo.ui.switch. For some reason, the chart does not re-render on switch value change; instead, it is toggling after I toggle the switch and then switch the view mode of the notebook (i.e. use the toggle app view button). This is the notebook in reference: https://marimo.io/p/@roboboosters/fin-frc
6 comments
M
M
A
problem: I was attempting to solve this issue and found that cells were automatically converting to different cell types.

Auto conversion from Python --> SQL
  • To mitigate some downstream dependency issues, I first tried converting the SQL cell to python (e.g, "df_result = mo.sql(f""" query """)") , and then would save the file, and then reset the Kernel. Post kernel reset, that cell that I converted to Python was back to being a SQL file.
  • I resolved this auto-conversion by making df_result local (_df_result) and then df_result = _df_result.copy().
  • Even though both were outputting the same DF, the python version seemed to work more extensively for dependencies.
Auto conversion from mo.sql + Python code --> SQL

  • I have data from an mo.sql outputting to a dataframe.
  • This dataframe is then used in am mo.md
  • Everything would be set up correctly - I would restart the kernel and the script would autorun
  • Upon restart/rerun, my cells with mo.sql + Python would convert to SQL. I tried many times to have the .py cell format stick.
  • To resolve this, I had to break out my mo.sql -> dataframe code (also unfortunately having to use the fix above) into a previous cell, and then display that resulting dataframe via an mo.md in the next cell.
Recommendation

Ideally, cells would not auto-convert from Python --> SQL. Some people might be more comfortable using mo.sql explicitly.

Additionally, ideally I could generate a DF with mo.sql in a cell, and also present that DF in mo.md. If this is undesired, then throwing an exception and stating this requirement would be helpful.
6 comments
A
r
Hello!

Problem: Following a kernel reset and full auto run, my SQL cells (not python cells) outputting a dataframe fail to work causing downstream execution issues.


  • Even though my DF output cells were referenced by downstream cells, meaning they should have run in-order, some downstream cells didn't find the dataframe.
  • To resolve this, I had to do an if not None statement before the downstream cells ran.
  • This required that I convert other SQL cells to python cells, which is not ideal
Ideally, I could create DFs with SQL cells and the downstream dependent cells would execute at the right time.
1 comment
A
New marimo install, trying to open a marimo notebook, the window sits on "Loading..." and the running notebooks pane activity indicator keeps scrolling.

  1. Install marimo extension in VS Code
  2. pip install marino
  3. restart VS Code
  4. open the marimo pane via extension button
  5. click on any file
In the terminal window, the following message appears:
PS C:\Users\user~~> marimo edit c:\Users\user\Documents~~ --host=localhost --port=2818 --headless --no-token
Error: No such option: --no-token
7 comments
M
M
I am creating a simple Altair bar chart, want to update it based on a filtered data but it is not getting updated. here is the flow of my code:
9 comments
S
A
M
I feel like this should just happen automatically, but if I try to go dark mode, my altair charts all get wonky. I expected I would get a dark background in my chart by default and my text would change to white.
18 comments
A
n
W
H
Posted by @nellyg

I am finding that quite frequently (and randomly) I am getting things getting stuck trying to display if they are large outputs (an accordion of multiple altair charts for example)

And I am seeing this output in the console:

Plain Text
[W 240925 08:18:26 distributor:64] BlockingIOError in distributor receive: [Errno 35] Resource temporarily unavailable
15 comments
A
n
I am using mo.ui.plotly to get a list of selected dots on a map and display the corresponding datapoints in a table below. However, if I make a selection, then double click on the map to clear the selection, the list of dicts returned stays the same (doesn't clear).
10 comments
M
M
I am editing a dataframe to replace null values with "unknown" prior to rendering it in a chart with Plotly. When the notebook runs in the online editor, it works as expected. However, if I share the link to the notebook with the project publish button, it seems that the cell rendering the chart somehow runs before the cell that replaces the values.
4 comments
M
A
M