'Failed to start the Kernel - Jupyter in VS Code

I am trying to use a Jupyter notebook for some Pandas in VS Code. I set up a virtual environment venv where I installed Pandas and jupyter. I always did it like this and it worked fine. But suddenly it does not work anymore. Code with error message



Solution 1:[1]

I got the same error message because the jupyter package was missing in my selected environment.

pip install jupyter

resolved the problem for me.

From the official VS Code documentation:

To work with Python in Jupyter Notebooks, you must activate an Anaconda environment in VS Code, or another Python environment in which you've installed the Jupyter package.

Solution 2:[2]

A workaround would be to run the kernel in a separate terminal (using the jupyter notebook command), and to connect to that kernel from VS Code (Click on "Jupyter Server: local" and choose the kernel running on localhost from the list).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 SirIcarus
Solution 2 Louis