简体   繁体   中英

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

Any help would be appreciated.

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 ")

在此处输入图像描述

Reference: Jupyter notebook in VS Code .

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM