VS Code kernel is empty

Question:

I got a issue that can’t run python in VS code, I have already install the python 3.8.5, and VS code python extension, if I switch to the 3.8.5 it shows this kernel is not started, and if I run the codes it will ask me to install the Data Science component and ipykernel, after I install the ipykernel it will switch to empty kernel automatically. Please refer to the screenshot:

Thanks.

screenshot VS code

Asked By: William

||

Answers:

I think there is a compatibility issue of jupyter with python 3.8

Try downgrading to python 3.7

Answered By: S4rt-H4K

When you run pip install ipykernel, the terminal shows ‘Requirement already statisfied’ and it exists in C:userswilliamappdataroamingpythonpython38site-packages. For python3.8.5, this ipykernel or other dependencies version is too low to support it, because python3.8.3 can use kernel well. Here is the solution:

  1. Turn to the directory, delete file ipykernel or directly empty the folder site-packages.
  2. Reinstall by pip install ipykernel, then juypter notebook works perfectly with python3.8.5:

enter image description here

Although working in the global environment is an easy way to get started, that environment will, over time, become cluttered with many different packages that you’ve installed for different projects. So it’s recommended to create a virtual environment for your project. About virtual environments, you can refer to python-venv.

Answered By: Molly Wang-MSFT

Another possibility for this exact issue is within extensions of VSCode:

  • if jupyter extension from Microsoft is disabled (greyed out in extension tab). Then kernel suggestion remains empty even with python env containing jupyterlab or ipykernel

worth checking as it is easy fix in this case.

Answered By: Alsushi
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.