diff --git a/sdks/python/apache_beam/runners/interactive/display/pipeline_graph.py b/sdks/python/apache_beam/runners/interactive/display/pipeline_graph.py index 10058351938e..098f3eb48bb7 100644 --- a/sdks/python/apache_beam/runners/interactive/display/pipeline_graph.py +++ b/sdks/python/apache_beam/runners/interactive/display/pipeline_graph.py @@ -237,6 +237,12 @@ def _construct_graph( default_edge_attrs: (Dict[str, str]) a dict of attributes """ with self._lock: + try: + pydot.Dot() + except NameError: + raise RuntimeError( + 'pydot is required for pipeline graph generation. ' + 'Install it with: pip install pydot') self._graph = pydot.Dot() if default_vertex_attrs: