Open akshayka opened 11 months ago
I see something like this when I'm running a marimo notebook as a script (e.g. python marimo_nb.py), and the notebook has marimo Html objects as cell outputs.
I'm running marimo 0.2.13.
Traceback (most recent call last):
File "...", line 202, in <module>
app.run()
File ".../.venv/lib/python3.11/site-packages/marimo/_ast/app.py", line 249, in run
return asyncio.run(self._run_async())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.8/Frameworks/Python.framework/Versions/3.11/lib/python3.11/asyncio/base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File ".../.venv/lib/python3.11/site-packages/marimo/_ast/app.py", line 230, in _run_async
outputs[cid] = await execute_cell_async(cell._cell, glbls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../.venv/lib/python3.11/site-packages/marimo/_ast/cell.py", line 386, in execute_cell_async
return eval(cell.last_expr, glbls)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/folders/_3/3t5t8_n5705dj1tp8hx0m6fw0000gq/T/marimo_40945/__marimo__cell_bkHC__output.py", line 45, in <module>
File ".../.venv/lib/python3.11/site-packages/marimo/_plugins/ui/_impl/table.py", line 170, in __init__
Function(
File ".../.venv/lib/python3.11/site-packages/marimo/_runtime/functions.py", line 42, in __init__
ctx = get_context()
^^^^^^^^^^^^^
File ".../.venv/lib/python3.11/site-packages/marimo/_runtime/context.py", line 142, in get_context
raise ContextNotInitializedError
marimo._runtime.context.ContextNotInitializedError
Exception ignored in: <function UIElement.__del__ at 0x10613e8e0>
Traceback (most recent call last):
File ".../.venv/lib/python3.11/site-packages/marimo/_plugins/ui/_core/ui_element.py", line 241, in __del__
File ".../.venv/lib/python3.11/site-packages/marimo/_output/hypertext.py", line 95, in __del__
My hunch is that this is a family of bugs related to errors encountered during script execution. I can open a new issue if that's preferred.
Describe the bug
(Reported by a user)
Environment
Code to reproduce
Difficult to reproduce ...