Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: don't break on vendored dependencies (#1421)

Dylan Madisettiaee247d87e8c
diff --git a/marimo/_output/formatters/formatters.py b/marimo/_output/formatters/formatters.py
index 9422d6f2a7..2afe7a2be3 100644
--- a/marimo/_output/formatters/formatters.py
+++ b/marimo/_output/formatters/formatters.py
@@ -80,7 +80,11 @@ def register_formatters() -> None:
# Because Python's import system caches modules, our formatters'
# register methods will be called at most once.
for finder in sys.meta_path:
- original_find_spec = finder.find_spec
+ # Note: "Vendored" dependencies may not have a find_spec method.
+ # E.g. `six` bundled with a project.
+ original_find_spec = getattr(finder, "find_spec", None)
+ if original_find_spec is None:
+ continue
# We include `original_find_spec` as a kwarg to force it to be bound
# to the new `find_spec` method; this is needed because closures are