Get help from the marimo community

When running a marimo notebook locally on my laptop copilot works as it should, but when I use the Visual Studio Code port forwarding feature and I connect to the same marimo notebook using the forwarded address, copilot stops working and I get a websockets.exceptions.InvalidURI: http://localhost:2918/copilot isn't a valid URI: scheme isn't ws or wss.
Any idea why this is happening? And how can this be fixed?
Hello,

I have been trying Marimo over the weekend and I find it great.
All the problems bothering me in Jupyter Notes and some I didn't even realize I had seem to be addressed in Marimo.

There is one thing I cannot seem to figure out:

If I create a plot (the most basic plot) using matplotlib it shows correctly as long as I'm in edit mode but as soon as
I switch to View mode, or slide mode, or I run marimo run my_notebook.py the matlib plots are not shown anymore.

I have also tried with plotly and I get the same problem, the plots are only visible when the notebook is in edit mode.

altair plots seem to be fine though ( they are also visible when I switch to view mode).

I thought this might be a limitation but then I saw examples where matplotlib is being used and the plots are successfully displayed,
like the example: Neural Networks with Micrograd
https://marimo.io/p/@marimo/micrograd

I've seen that the exmaple uses WASM and tried to generate a WASM application from my notebook using:
Plain Text
marimo export html-wasm notebook.py -o notebook.wasm.html

and then serving the generated html.

This did not seem to make any difference, the matplotlib plots still do not show.

Am I missing something ?

Thank you in advance for any answers or suggestions.
7 comments
H
R
I did following

  • uv init
  • uv venv
  • source .venv/bin/activate
  • uv add marimo (same problem if using ipykernel or jupyterlab)
  • Open marimo and getting this error:
ImportError: Cannot import 'TreeArgumentsWrapper' from 'jedi.inference.arguments' due to circular import.

marimo and jupyterlab works fine when installed and using with pip.
I have a altair.Chart() which outputs fine if I render it directly but if I wrap it in a mo.ui.altair_chart() then the string x-axis values which are versions of the form "x.y.x" are getting evaluated as datetimes so the graph is exactly the same except the x-values are erroneously shown as datetimes. How can I stop this? See https://imgur.com/a/0wFfaYk. First graph is raw altair graph, second is wrapped graph.
8 comments
b
M
cant connect copilot on marimo notebooks
~ Ash Blanc
4 comments
H
Its just saying 'unable to connect'
5 comments
A
A
H
Hello,
I was planning to use the newest testing feature for my notebook, but unfortunately i'm facing an error when trying to run cells from another notebook dedicated to testing.
Using the Cell.run() function throws a TypeError This cell raised an exception: TypeError('unhashable type: 'DataFrame' / 'dict') when using a pandas DataFrame or a dictionary as one of the kwargs.
I am using the latest version. Thanks in advance!
4 comments
A
B
dataframe column value contains hyphen and number suffix
value of n-a gets correct nominal type
value of n-0 gets incorrect temporal type
2 comments
S
l
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.
1 comment
M
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