Skip to content

Commit b39db73

Browse files
committed
Auto detect Spyder and enable SVG renderer
1 parent 09f7879 commit b39db73

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

+12-1
Original file line numberDiff line numberDiff line change
@@ -471,10 +471,21 @@ def show(fig, renderer=None, validate=True, **kwargs):
471471
if not default_renderer and "VSCODE_PID" in os.environ:
472472
default_renderer = "vscode"
473473

474-
# Cheick if we're running in nteract
474+
# Check if we're running in nteract
475475
if not default_renderer and "NTERACT_EXE" in os.environ:
476476
default_renderer = "nteract"
477477

478+
# Check if we're running in spyder and orca is installed
479+
if not default_renderer and "SPYDER_ARGS" in os.environ:
480+
try:
481+
from plotly.io.orca import validate_executable
482+
483+
validate_executable()
484+
default_renderer = "svg"
485+
except ValueError:
486+
# orca not found
487+
pass
488+
478489
# Fallback to renderer combination that will work automatically
479490
# in the classic notebook (offline), jupyterlab, nteract, vscode, and
480491
# nbconvert HTML export.

0 commit comments

Comments
 (0)