Recently I keep running into problems with my python notebooks in vscode where vscode doesn’t see the installed ipykernel
. There are several posts on this issue with suggestions to update certain packages (VSCode not picking up ipykernel, Python requires ipykernel to be installed, vscode not detecting ipykernel, verified it is actually installed, Install ipykernel in vscode – ipynb (Jupyter), …)
This makes me wonder what the actual minimum requirements are. Different "offical" channels mention different dependencies:
- https://code.visualstudio.com/docs/datascience/jupyter-notebooks#_setting-up-your-environment mentions
jupyter
- https://github.com/microsoft/vscode-jupyter/wiki/Jupyter-Kernels-and-the-Jupyter-Extension#python-environments mentions
ipython
andipykernel
- https://github.com/microsoft/vscode-jupyter/wiki/Installing-Jupyter mentions
jupyter
may be required.
Previously I only had
ipykernel
notebook
installed in the conda environment which worked just fine.
So what are the actual requirements to run jupyter notebooks in vscode? What are the needed packages with versions?
2
Answers
To run Jupyter notebooks in Visual Studio Code, ensure you have the following packages installed in your Python environment:
jupyter: Core Jupyter components.
ipython: Interactive Python shell.
ipykernel: Jupyter kernel for different Python environments.
Additionally, install the official Jupyter extension in Visual Studio Code. Ensure you’ve installed the Python interpreter.
The official document states that all you need is install the jupyter package by command
pip install jupyter
, which includes notebook, qtconsole, and the IPython kernel.At the same time, Jupyter extension in the vscode extension store is also necessary.