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: do not require plotly or bokeh when holoviews is used (#2199)

mb-9152a8540626582
diff --git a/marimo/_dependencies/dependencies.py b/marimo/_dependencies/dependencies.py
index 44da4885dc..4f1536f579 100644
--- a/marimo/_dependencies/dependencies.py
+++ b/marimo/_dependencies/dependencies.py
@@ -141,6 +141,7 @@ class DependencyManager:
duckdb = Dependency("duckdb")
pillow = Dependency("PIL")
plotly = Dependency("plotly")
+ bokeh = Dependency("bokeh")
pyarrow = Dependency("pyarrow")
openai = Dependency("openai")
matplotlib = Dependency("matplotlib")
diff --git a/marimo/_output/formatters/holoviews_formatters.py b/marimo/_output/formatters/holoviews_formatters.py
index 8996203245..2646e9b4fd 100644
--- a/marimo/_output/formatters/holoviews_formatters.py
+++ b/marimo/_output/formatters/holoviews_formatters.py
@@ -58,9 +58,11 @@ class HoloViewsFormatter(FormatterFactory):
def apply_theme(self, theme: Theme) -> None:
import holoviews as hv # type: ignore
- hv.renderer("bokeh").theme = (
- "dark_minimal" if theme == "dark" else None
- )
- hv.renderer("plotly").theme = (
- "plotly_dark" if theme == "dark" else "plotly"
- )
+ if DependencyManager.bokeh.has():
+ hv.renderer("bokeh").theme = (
+ "dark_minimal" if theme == "dark" else None
+ )
+ if DependencyManager.plotly.has():
+ hv.renderer("plotly").theme = (
+ "plotly_dark" if theme == "dark" else "plotly"
+ )