Skip to content

Commit

Permalink
use matplotlib inline backend by default (via MPLBACKEND environment …
Browse files Browse the repository at this point in the history
…variable)
  • Loading branch information
jjallaire committed Apr 2, 2022
1 parent 0e37d35 commit 980605f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/execute/jupyter/jupyter-kernel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ async function execJupyter(
...(await pythonExec()),
resourcePath("jupyter/jupyter.py"),
],
env: {
// Force default matplotlib backend. something simillar is done here:
// https://github.com/ipython/ipykernel/blob/d7339c2c70115bbe6042880d29eeb273b5a2e350/ipykernel/kernelapp.py#L549-L554
// however this respects existing environment variables, which we've seen in at least
// one case result in an inability to render due to the iTerm2 backend being configured
// (see https://github.com/quarto-dev/quarto-cli/issues/502). Our current position is
// that the way to use a different backend w/ Quarto is to call the matplotlib.use()
// function within the notebook
"MPLBACKEND": "module://matplotlib_inline.backend_inline",
},
stdout: "piped",
},
kernelCommand(command, "", options),
Expand Down

0 comments on commit 980605f

Please sign in to comment.