The setup cell contains logic that must be run before any other
cell runs, including top-level imports used by top-level
functions. For this reason, it can't refer to other cells'
variables.
Try simplifying the setup cell to only contain only necessary
variables.
Learn more at our docs{" "}
.
,
);
}
if (cycleErrors.length > 0) {
messages.push(
An example of a cycle is if one cell declares a variable 'a' and
reads 'b', and another cell declares 'b' and and reads 'a'. Cycles
like this make it impossible for marimo to know how to run your
cells, and generally suggest that your code has a bug.
Try merging these cells into a single cell to eliminate the cycle.
marimo requires that each variable is defined in just one cell.
This constraint enables reactive and reproducible execution,
arbitrary cell reordering, seamless UI elements, execution as a
script, and more.
Try merging this cell with the mentioned cells or wrapping it in a
function. Alternatively, prefix variables with an underscore
(e.g., _{firstName}). to make them
private to this cell.
Learn more at our docs{" "}
.
to experiment without restrictions on variable names.
,
);
}
if (importStarErrors.length > 0) {
messages.push(
{importStarErrors.map((error, idx) => (
{error.msg}
))}
{cellId && (
)}
Star imports are incompatible with marimo's git-friendly file
format and reproducible reactive execution.
marimo's Python file format stores code in functions, so notebooks
can be imported as regular Python modules without executing all
their code. But Python disallows `import *` everywhere except at
the top-level of a module.
Star imports would also silently add names to globals, which would
be incompatible with reactive execution.
Learn more at our docs{" "}
.
,
);
}
if (interruptionErrors.length > 0) {
messages.push(
{interruptionErrors.map((_, idx) => (
{"This cell was interrupted and needs to be re-run."}
))}
{cellId && (
)}
,
);
}
if (exceptionErrors.length > 0) {
messages.push(
{processTextForUrls(error.msg, `exception-${idx}`)}
{"traceback" in error && error.traceback && (
{renderHTML({ html: error.traceback })}
)}
)}
);
})}
{exceptionErrors.some((e) => e.raising_cell != null) && (
Fix the error in the mentioned cells, or handle the exceptions
with try/except blocks.
)}
{cellId && }
,
);
}
if (strictExceptionErrors.length > 0) {
messages.push(
{strictExceptionErrors.map((error, idx) => (
{error.blamed_cell == null ? (
{error.msg}
) : (
{error.msg}
)}
))}
{cellId && (
)}
{strictExceptionErrors.some((e) => e.blamed_cell != null)
? "Ensure that the referenced cells define the required variables, or turn off strict execution."
: "Something is wrong with your declarations. Fix any discrepancies, or turn off strict execution."}
,
);
}
if (internalErrors.length > 0) {
messages.push(
{internalErrors.map((error, idx) => (
{error.msg}
))}
{cellId && }
,
);
}
if (ancestorPreventedErrors.length > 0) {
messages.push(