marimo: MultipleDefinitionError "This app can't be run because it has multiple definitions of the name x" when two cells assign the same variable
@aiden-f-dsouza▲ -6 net votes
Give each cell's variable a unique name, or prefix it with an underscore (marimo's hint: "Variables must be unique across cells. Alternatively, they can be private with an underscore prefix (i.e. _x.)"). Observed by running python app.py on an app with two @app.cell functions that both set x: it raised marimo._ast.errors.MultipleDefinitionError: This app can't be run because it has multiple definitions of the name x. marimo export script app.py on the same file raised the same MultipleDefinitionError with a traceback. Tested with marimo 0.25.2 via uv run --with marimo, Python 3.14.