Please see solution here microsoft/vscode#130946 (comment)
VS Code - How do I select Jupyter Kernel for a workspace? - Stack Overflow
VSCode, Python, Jupyter Extension - "Select Kernel" does not find anything
python - VS Code - Jupyter notebook doesn't automatically select the default kernel - Stack Overflow
VS Code does not find Python kernel - Stack Overflow
Videos
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

Had to update the Jupyter extension, even though I had auto-update on.
I had a lot of problems myself in getting the updated list of jupyter kernel servers in old versions of Visual Studio code.
However, in the newer version of Visual Studio code (I am using version 1.76.2 on my ubuntu 18.04 machine; I hope this works also on Mac OS), you don't need to specify the jupyter kernel anymore: it is now enough to specify the python environment. This new feature and its use are described in this howto from visualstudio.
In short, once I installed the correct version of Visual Studio code, I performed the following steps:
- I first make a virtual environment and install ipykernel in it:
virtualenv --python=python3 venv . venv/bin.activate pip3 install ipykernel
- In Visual Studio code, while having opened a python file, I select using ctrl+shift+P (Shift+Command+P in Mac OS) the python interpreter (Python:Select Interpreter) and choose the one of the virtual environment that I have just created: /path/to/venv/bin/python. In my case, this step was necessary: indeed, I first had to choose the desired python interpreter on any python file before proceeding to the following step
- In Visual Studio code still, while having opened a notebook file (.pynb file), I click on select kernel on the top right of the IDE, then click on "Python Environments": the environment I selected before for the python file (/path/to/venv/bin) will appear here, without having to add environments to the kernel lists. Once this environment is selected, the notebook should work as expected,
I hope it helps.
This way is not easy. You can set up Jupyter Kernel easily. Firstly, using ssh to connect to the remote server. Secondly, open Command Palette (⇧⌘P) and enter Python: Select Interpreter, you can directly connecting to remote kernel.
resource: https://code.visualstudio.com/docs/datascience/jupyter-notebooks
Pip installing jupyter and creating an ipykernel for your virtual environment should allow the Jupyter VSCode extension to see that environment in the "Notebook: Select Notebook Kernel" dropdown. You may need to restart VSCode (or just the extension?)
According to the Jupyter VSCode extension docs
A Visual Studio Code extension that... allows any Python environment to be used as a Jupyter kernel. This is NOT a Jupyter kernel--you must have Python environment in which you've installed the Jupyter package.
I also tried just creating the kernel on the SSH server, but the Jupter extension still didn't pick it up as an option for "Notebook: Select Notebook Kernel" until I pip installed jupyter and restarted VSCode.
System info: VSCode 1.79.2 for Linux x64, into an ubuntu SSH server. Jupyter VSCode extension v2023.5.1101742258
guys when i want to select a kernel there is no list of kernels also i cant run jupyter code as it doesnt show run option to the left of the code
You need to select the python interpreter for jupyter, you can do it by following the step
Open command panel
Mac:
CMD+Shift+PPC:
CTRL+SHIFT+PThen search for
select Interpreter to start jupyter serverthen hit enter, it will list all the interpreter, then select any interpreter and done!
it's just a one time process, after this, it will get connected automatically.
As bizarre as it seems, I also noticed this the other day and the only thing that works so far for me is to open VS Code by launching it from the Anaconda Navigator:

Then I get, as expected:

Hi. I'm trying to run some code in a Jupyter notebook in VSCode. Whenever I try to do this, I get a pop up that asks me to select a kernel. I also see this is written on the top right of the window I'm in. The problem is that there is nothing in this dropdown menu, and I therefore cannot run anything.
I am running VSCode with the Python and Jupyter extensions installed. I've created a virtual environment and installed ipykernel. I've also tried to install jupyter to see if that helped, but it didn't. And yes, the environment is selected (by opening the menu in VSCode, selecting "Select Python interpreter" and picking the Python-binary in .venv). I've rebooted my machine and reinstalling the extensions, yet it does not solve the issue. Running normal python files works fine.
Any tips? Cheers.
I had exactly the same problem when I installed Visual Studio Code and tried to run some Python code from a Jupyter Notebook document on my fresh Ubuntu 18.04 (Bionic Beaver).
How I solved it:
Make sure you have installed the Jupyter Extension in Visual Studio Code (for those who don't read the Stack Overflow question :))
Press Command + Shift + P to open a new Command Palette
Type Python: Select interpreter to start Jupyter Notebook server
Open the notebook again
And it worked fine.
I have several versions of Python installed. It happened the same thing to me and I have fixed it this way.
Ctrl + Shift + P and select Python: Select Interpreter to start Jupyter server

Then, select the version under the Visual Studio Code

Nothing will happen and then press again Ctrl + Shift + P and select Python: Create new blank Jupyter Notebook. And it works.
I have even set the Python version to 3.8 at the bottom, and it worked too with the new features print(a:=4), despite the fact that the version I have chosen was 3.7.5. Nevertheless, I have to launch Visual Studio Code from Anaconda Navigator.

I think there is no parameter right now to control that in the settings.json. I had similar problems with the environments in which the notebook is launched and I was able to fix this modifying the kernelspec section in the IPython notebook.
Basically, open the notebook as a JSON file and remove the kernelspec section. When the notebook is launched from vscode, that part will be filled with the default python environment kernel for the workspace. In my case, is filled with the pipenv environment.
maybe this helps, but maybe not. I ran into this issue during a ssh session on a remote machine. I had to use the VS code command > Python: Select Interpreter

form here I needed to add the location to the environment I wished to work form.

so long as jupyter is installed in the path there should be no issues (: