VS Code - Jupyter notebook doesn't automatically select the default kernel

Viewed 2752

I have created a simple jupyter notebook in VS Code and selected it to use my default python3 kernel (/usr/local/bin/python3). Everything works great.

Then, I close VS Code and re-open the notebook, it asks me to select the kernel every time.

Is there a way to default the kernel of this notebook to my python3 interpreter?

In case it helps, when I view the notebook json, it has the following in it:

        "kernelspec": {
        "name": "python3",
        "display_name": "Python 3.9.6 64-bit"
2 Answers

It's not available for now, but they think it is a reasonable request, and considering it. You can refer to this page.

Two ways

one:

You can go into the command Juptyer: Filter Kernels

use command to filter out kernals, all kernals follow alphanumeric order. So, u can tick a few https://github.com/microsoft/vscode-jupyter/discussions/10130

two:

ps. Can try, but might not work after a while? idk why, but it works once.

Enforce choices to only 1, then reload vscode windows

"jupyter.kernels.filter": [
      {
        "path": "/bin/python3"
      }
    ]

Meanwhile you can visually browser all the paths on ur local Click the text button at the top right corner. <Python 3.x****>

It pops up like below

how to pick path ?

Related