VSCode, Python, Jupyter Extension - "Select Kernel" does not find anything
How to specify a default Jupyter kernel via configuration?
python - How does one connect a Jupyter Kernel to VS Code if one does not connect automatically? - Stack Overflow
No kernel dropdown when trying to run Jupyter in VSCode
Videos
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.
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.
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.
