Have quarto find the jupyter kernel within Visual Studio Code #10026
Replies: 2 comments 9 replies
-
Did you read the following: https://quarto.org/docs/computations/python.html#kernel-selection In particular the "important note"? Also, If you run |
Beta Was this translation helpful? Give feedback.
-
To see what I am referring to, could you please just have a look at this link from the quarto docs: https://quarto.org/docs/get-started/hello/vscode.html which is the one I am referring to all along, and the one we're discussing about. In particular, please read the following in that quarto page: Now, you could say that the document is discussing about things that are not strictly related with Quarto, but about installing jupyter and so on. And I can see your point. But at the same time I would argue that the objective of this documentation is actually to help users set up VS Code, including how to install jupyter so that VS Code picks it up, which in turn is a necessary prerequisite to be able to have quarto render qmd documents that have python code. If you agree with that point of view (even if it is not yours, which I totally respect), then you can see that it is of interest to this community to discuss how to do the same thing but not within the default base conda environment, since this is an anti-pattern. You might agree or not with that, but the question and possible answers are still of interest to many people who want to use Quarto integrated with VS Code without polluting the base environment. Note that this is rarely needed when using VS Code outside of the current case. |
Beta Was this translation helpful? Give feedback.
-
Description
I am trying to follow this vscode tutorial in the quarto.org site.
The tutorial uses a document
hello.qmd
whose content can be copied from the same tutorial. We need to edit thehello.qmd
to indicate the jupyter kernel we will be using. Let us assume it ismy_kernel
, we change the header to be:Now, the trick is to have quarto find the kernel
my_kernel
. If I just try to preview the document (with the quarto extension installed as indicated in the tutorial), I get the following type of error:Then if I run
quarto check jupyter
I get:The issue seems that quarto preview is run within the
base
conda environment. In the mentioned tutorial, we are instructed to install jupyter in this base environment. However, I don't want to install anything in that base environment (I never do it). Does anyone know of an easy way to indicate the conda environment to be used, the one associated with the kernel for running the code in the qmd file?I know the question might be more related with VS Code settings, but any help is appreciated. Thanks!
[Note: In my case, I am running VS Code from within WSL (by using the remote VSCode connection
WSL:Ubuntu
)].Beta Was this translation helpful? Give feedback.
All reactions