Skip to content

Commit 92b8954

Browse files
committed
Display kaleido installation instructions when neither kaleido nor orca are installed
1 parent 03979d1 commit 92b8954

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: packages/python/plotly/plotly/io/_kaleido.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,19 @@ def to_image(
9292
# -------------
9393
if engine == "auto":
9494
if scope is not None:
95+
# Default to kaleido if available
9596
engine = "kaleido"
9697
else:
97-
engine = "orca"
98+
# See if orca is available
99+
from ._orca import validate_executable
100+
101+
try:
102+
validate_executable()
103+
engine = "orca"
104+
except:
105+
# If orca not configured properly, make sure we display the error
106+
# message advising the installation of kaleido
107+
engine = "kaleido"
98108

99109
if engine == "orca":
100110
# Fall back to legacy orca image export path

0 commit comments

Comments
 (0)