How to fix "Error: Direct kernel connection broken"?

Viewed 4649

I've been using Jupyter notebooks in VSCode and it has worked fine for several months. Yesterday, I cleaned out a ton of my storage because it was cluttered and overfilled. Now my VSCode will either return an "Error: Direct kernel connection broken" or it will not install any of my previous packages. Can anybody help me fix this issue?

4 Answers

Switch kernel from .venv to default then switch it back again. then run all cells, not the current cell.

I also stuck with the same problem :

  1. Try to do this

pip install ipython

pip install ipykernel

  1. If you already have a kernel installed, upgrade it

pip install --upgrade ipython

pip install --upgrade ipykernel

It works for me

Switching the Jupyter server away from default and back again fixed this for me

According to your description, please refer to the following:

  1. Please try to reinstall the kernel module "ipykernel" required by'Jupyter' in the current python environment: (pip install ipykernel)

  2. If it still doesn't work, please try to use other python environments and check if the python interpreter and "Python" extension and "Jupyter" extension are available.

Reference: Jupyter in VS Code and Python environments in VS Code.

Related