Skip to content

Commit

Permalink
src/sage/plot/plot3d/base.pyx: Call playwright install chromium befor…
Browse files Browse the repository at this point in the history
…e use
  • Loading branch information
mkoeppe committed Aug 29, 2024
1 parent 2d4522e commit b32f729
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sage/plot/plot3d/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,10 @@ end_scene""".format(
try:
scene = self._rich_repr_threejs(**opts)
from playwright.sync_api import sync_playwright
import subprocess
# From https://github.com/jupyter/nbconvert/blob/55ff3e9ac1d892165bfb4352379672019b66ddff/nbconvert/exporters/webpdf.py#L87
cmd = [sys.executable, "-m", "playwright", "install", "chromium"]
subprocess.check_call(cmd)
with sync_playwright() as p:
browser_type = getattr(p, kwds.pop('browser_type', 'chromium'))
browser = browser_type.launch()
Expand Down

0 comments on commit b32f729

Please sign in to comment.