Quarto render used wrong Jupyter/Python Interpreter

I am trying to create a Quarto Python document like this https://quarto.org/docs/computations/python.html#overview.

In the RStudio terminal I set QUARTO_PYTHON to use the correct python version.

quarto check 

points to the right Python installation and Jupyter engine render.

But when I try to render the document, Quarto complains that Jupyter is not available and also points to the wrong Python installation. How can I fix this?

1 Like

Is quarto check ran inside the same project folder than your Quarto project ? I would expect the result to be coherent, but maybe we are missing something. Python environment can be configured at folder level and a lot of different ways (pyenv, venv, conda, ...) so a lot can happen.

Are you using virtual environment ? Quarto - Virtual Environments

This could have an effect on the version used. Also, which Jupyter kernel are you using ? You should check the Jupyter kernels are configured correctly to use the python version you expect.

You can list kernels with jupyter kernelspec list and cat into the file to check the configuration

Other methods are described here: How to Know Which Python is Running in Your Jupyter Notebook | Saturn Cloud Blog

I'm running quarto check in the same folder I have my Quarto document. I am working an a HPC and usually load the python environment via environment modules, like ml jupyter. jupyter kernelspec list returns the python3 path, with jupyter version 4.10.0

This would indicate that jupyter is correctly configured. So if you are using QUARTO_PYTHON, the specific python version will be used, then Jupyter will have kernels that you can choose in YAML header.

If for some reason, it is not finding jupyter, something is not right somewhere on the HPC node maybe. Can you check in the documents that QUARTO_PYTHON is set ?

---
title: check env
format: html
---

`QUARTO_PYTHON` is set to {{< env QUARTO_PYTHON >}}

This should be working and not needing Jupyter to render

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.