Get help from the marimo community

Updated 2 months ago

RuntimeContext was already initialized.

At a glance

The community member posted a question about an error they encountered when using mo.Thread, asking if anyone else had experienced the same issue and if there were any clues about it. Another community member responded with a minimal reproduction example that worked for them, but the original poster later acknowledged that they had done something stupid and apologized for the noise.

Did anyone run into this error when using mo.Thread? Any clue about it?
M
b
2 comments
do you have a minimal reproduction? i just tried it out and works for me:

Plain Text
import marimo

__generated_with = "0.9.25"
app = marimo.App()


@app.cell
def __():
    import marimo as mo
    return (mo,)


@app.cell
def __():
    def foo():
        print("hi")
    return (foo,)


@app.cell
def __(foo, mo):
    with mo.redirect_stdout():
        mo.Thread(target=foo).start()
    return


if __name__ == "__main__":
    app.run()
Ah, sorry, I did something stupid. Thanks for the reply and sorry for the noise! πŸ™
Add a reply
Sign up and join the conversation on Discord