Manage Jupyter Kernels in VS Code

The Visual Studio Code notebooks' kernel picker lists the following categories of connection methods to run the code in your Jupyter notebook:

By default, VS Code will recommend the one you've previously used with your notebook, but you can choose to connect to any other Jupyter kernels as shown below.

Jupyter Kernels

The Jupyter Kernels category lists all Jupyter kernels that VS Code detects in the context of the compute system it's operating in (your desktop, GitHub Codespaces, remote server, etc.). Each Jupyter kernel has a Jupyter kernel specification, or Jupyter kernelspec, which contains a JSON file (kernel.json) with details about the kernel—name, description, and CLI information required to launch a process as a kernel.

Python Environments

The Python Environments category lists the Python environments that VS Code detects from the compute system it's operating in (your desktop, Codespaces, remote server, etc.). It shows all Python environments grouped by type (for example, conda, venv)—whether the IPyKernel is installed or not.

Note: You do not need to install jupyter into the Python environment you want to use. Only the IPyKernel package is required to launch a Python process as a kernel and execute code against your notebook (pip install ipykernel). Visit the Jupyter extension wiki to learn more.

Existing Jupyter Server

The Existing Jupyter Server category lists remote Jupyter servers previously connected. You can also use this option to connect to an existing Jupyter server running remotely or locally. Find the URL for your Jupyter server, for example, http://<ip-address>:<port>/?token=<token> and paste it in the Enter the URL of the running Jupyter server option to connect to the remote server and execute code against your notebook using that server.

Enter server URL

When you're starting your remote server, be sure to:

  1. Allow all origins (for example --NotebookApp.allow_origin='*') to allow your servers to be accessed externally.
  2. Set the notebook to listen on all IPs (--NotebookApp.ip='0.0.0.0').

Once connected, all active Jupyter sessions will appear on this list.

You can create a new session from the server's kernelspec by:

  1. Running the Notebook: Select Notebook Kernel command.
  2. Choose Select Another Kernel.
  3. Choose Existing Jupyter Server.
  4. Select your server.

Questions or feedback

You can add a feature request or report a problem by creating an issue in our repository, which is actively being monitored and managed by our engineering team.