Problems rendering a quarto qmd file through jupyter in VS Code

I’m trying to preview a .qmd file using quarto with jupyter in VS Code. There is a little banner in the bottom right corner that shows up when trying to render the .qmd that says " command ‘quarto.preview’ not found ".

It is a desktop PC running Windows 10, x64

Running quarto check in the terminal throws an error. I had to enable error logging with $env:QUARTO_PRINT_STACK = “true” which I got from this page → Quarto – Troubleshooting in order to see the errors below.

It’s showing that there’s a problem with Jupyter, not quarto. I have tried uninstalling and reinstalling everything- it’s all the latest version.

Here is the full output when I run quarto check in the VS Code terminal:

Quarto 1.4.543
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.543
      Path: C:\Program Files\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Tex:  (not detected)

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.11.5
      Path: C:/Users/Ben's PC/AppData/Local/Programs/Python/Python311/python.exe       
      Jupyter: 5.7.1
      Kernels: python3

(-) Checking Jupyter engine render....

An error occurred while executing the following cell:
------------------

# imports
import os
import sys
import types
import json

# figure size/format
fig_width = 7
fig_height = 5
fig_format = 'retina'
fig_dpi = 96
interactivity = ''
is_shiny = False
is_dashboard = False
plotly_connected = True

# matplotlib defaults / format
try:
  import matplotlib.pyplot as plt
  plt.rcParams['figure.figsize'] = (fig_width, fig_height)
  plt.rcParams['figure.dpi'] = fig_dpi
  plt.rcParams['savefig.dpi'] = fig_dpi
  from IPython.display import set_matplotlib_formats
  set_matplotlib_formats(fig_format)
except Exception:
  pass

# plotly use connected mode
try:
  import plotly.io as pio
  if plotly_connected:
    pio.renderers.default = "notebook_connected"
  else:
    pio.renderers.default = "notebook"
  for template in pio.templates.keys():
    pio.templates[template].layout.margin = dict(t=30,r=0,b=0,l=0)
except Exception:
  pass

# disable itables paging for dashboards
if is_dashboard:
  try:
    from itables import options
    options.dom = 'fiBrtlp'
    options.maxBytes = 1024 * 1024
    options.language = dict(info = "Showing _TOTAL_ entries")
    options.classes = "display nowrap compact"
    options.paging = False
    options.searching = True
    options.ordering = True
    options.info = True
    options.lengthChange = False
    options.autoWidth = False
    options.responsive = True
    options.keys = True
    options.buttons = []
  except Exception:
    pass

  try:
    import altair as alt
    # By default, dashboards will have container sized
    # vega visualizations which allows them to flow reasonably
    theme_sentinel = '_quarto-dashboard-internal'
    def make_theme(name):
        nonTheme = alt.themes._plugins[name]
        def patch_theme(*args, **kwargs):
            existingTheme = nonTheme()
            if 'height' not in existingTheme:
              existingTheme['height'] = 'container'
            if 'width' not in existingTheme:
              existingTheme['width'] = 'container'

            if 'config' not in existingTheme:
              existingTheme['config'] = dict()

            # Configure the default font sizes
            title_font_size = 15
            header_font_size = 13
            axis_font_size = 12
            legend_font_size = 12
            mark_font_size = 12
            tooltip = False

            config = existingTheme['config']

            # The Axis
            if 'axis' not in config:
              config['axis'] = dict()
            axis = config['axis']
            if 'labelFontSize' not in axis:
              axis['labelFontSize'] = axis_font_size
            if 'titleFontSize' not in axis:
              axis['titleFontSize'] = axis_font_size

            # The legend
            if 'legend' not in config:
              config['legend'] = dict()
            legend = config['legend']
            if 'labelFontSize' not in legend:
              legend['labelFontSize'] = legend_font_size
            if 'titleFontSize' not in legend:
              legend['titleFontSize'] = legend_font_size

            # The header
            if 'header' not in config:
              config['header'] = dict()
            header = config['header']
            if 'labelFontSize' not in header:
              header['labelFontSize'] = header_font_size
            if 'titleFontSize' not in header:
              header['titleFontSize'] = header_font_size

            # Title
            if 'title' not in config:
              config['title'] = dict()
            title = config['title']
            if 'fontSize' not in title:
              title['fontSize'] = title_font_size

            # Marks
            if 'mark' not in config:
              config['mark'] = dict()
            mark = config['mark']
            if 'fontSize' not in mark:
              mark['fontSize'] = mark_font_size

            # Mark tooltips
[>] Checking Jupyter engine render....OK

ERROR: Error
    at renderFiles (file:///C:/Program%20Files/Quarto/bin/quarto.js:77069:29)
    at eventLoopTick (ext:core/01_core.js:183:11)
    at async render (file:///C:/Program%20Files/Quarto/bin/quarto.js:81802:21)
    at async checkJupyterRender (file:///C:/Program%20Files/Quarto/bin/quarto.js:98587:21)
    at async file:///C:/Program%20Files/Quarto/bin/quarto.js:98551:21
    at async withSpinner (file:///C:/Program%20Files/Quarto/bin/quarto.js:75268:16)    
    at async checkJupyterInstallation (file:///C:/Program%20Files/Quarto/bin/quarto.js:98547:17)
    at async check (file:///C:/Program%20Files/Quarto/bin/quarto.js:98399:13)
    at async Command.fn (file:///C:/Program%20Files/Quarto/bin/quarto.js:98679:5)      
    at async Command.execute (file:///C:/Program%20Files/Quarto/bin/quarto.js:8102:13) 

I’m honestly out of my depth here, any help appreciated.

I think this might be a question for quarto folks. I’m not sure how many are here.

1 Like