Unable to start session for jupyter kernel python vscode

I have looked at other issues posted on stack overflow and github:

https://github.com/microsoft/vscode-jupyter/issues/728 Unable to start Jupyter notebook on VS Code

A lot of people could run this command:

python -m pip install 'traitlets==4.3.3' --force-reinstall

And this would resolve issues with the jupyter kernel not loading within vscode.

I consistently have issues connecting to the kernel and after a period of time I am presented with a message:

Unable to start session for kernel Python 3.7.4 64 bit ('name_of_virtual_environment'). Select another kernel to launch with.

I am using wsl 2 with ubuntu 20.04 LTS and I have selected the correct python interpreter (for the python extension and in the actual notebook). I am also using pyenv to create my virtual environments. vscode version 1.52.1

Upvotes: 1

Views: 11345

Answers (2)

eyesome
eyesome

Reputation: 21

uninstall jupyter and its dependencies, then reinstall them.

pip uninstall jupyter
pip uninstall jupyter_core
pip uninstall jupyter-client
pip uninstall jupyter-console
pip uninstall jupyterlab_pygments
pip uninstall notebook
pip uninstall qtconsole
pip uninstall nbconvert
pip uninstall nbformat`

reinstall jupyter notebook and plugins

pip install jupyter
pip install jupyter_core
pip install jupyter-client
pip install jupyter-console
pip install jupyterlab_pygments
pip install notebook
pip install qtconsole
pip install nbconvert
pip install nbformat

Upvotes: 2

Jill Cheng
Jill Cheng

Reputation: 10354

It is recommended that you check whether the dependency package "ipykernel" required by Jupyter notebook has been successfully installed in your chosen python environment: ("pip show ipykernel")

enter image description here

Reference: Jupyter notebook in VS Code.

Upvotes: 3

Related Questions