# Open notebooks with no kernel & without "Select Kernel" popup

**URL:** <https://discourse.jupyter.org/t/open-notebooks-with-no-kernel-without-select-kernel-popup/25226>\
**Category:** JupyterLab\
**Tags:** help-wanted\
**Created:** [April 17, 2024, 9:45am UTC](https://discourse.jupyter.org/t/open-notebooks-with-no-kernel-without-select-kernel-popup/25226 "2024-04-17T09:45:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![CalvinMT](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/calvinmt/32/10493_2.png) [@CalvinMT](https://discourse.jupyter.org/u/CalvinMT)\
**Post date:** [April 17, 2024, 9:45am UTC](https://discourse.jupyter.org/t/open-notebooks-with-no-kernel-without-select-kernel-popup/25226/1 "2024-04-17T09:45:33Z")

</div>

Hi!

Is there a way to open an notebook in JupyterLab (v4.1.6) without starting any kernels and without having the “Select Kernel” popup appear each time I open a notebook without a kernel specified under its “kernelspecs”?

I have tried setting the “kernelspecs” of notebooks to the following, but JupyterLab keeps asking me to select a kernel:

```auto
{
  "cells": [],
  "metadata": {
    "kernelspec": {
      "display_name": "",
      "language": "",
      "name": null
    }
  }
}

```

I have also seen this post: [How to open a notebook without starting the kernel](https://discourse.jupyter.org/t/how-to-open-a-notebook-without-starting-the-kernel/5448)  
But I don’t want to use “nbviewer”. JupyterLab offers the possibility to open a notebook without running a kernel, which is good enough. I just want it to be automatic depending on the notebook’s metadata, if possible. Either from the notebook’s metadata, or from a Notebook/Server/JupyterLab configuration.

Or, maybe, is there a way to disable the “Select Kernel” popup?

---

<div class="post-metadata">

**Author:** ![CalvinMT](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/calvinmt/32/10493_2.png) [@CalvinMT](https://discourse.jupyter.org/u/CalvinMT)\
**Post date:** [April 17, 2024, 2:04pm UTC](https://discourse.jupyter.org/t/open-notebooks-with-no-kernel-without-select-kernel-popup/25226/2 "2024-04-17T14:04:20Z")

</div>

It is possible to disable automatic kernel start when opening a notebook through a JupyterLab configuration. This configuration in turns disables the “Select Kernel” popup when opening an notebook with an empty “kernelspec” field.

I found out about this configuration in the following GitHub issue: [Open a notebook with no kernel or an existing kernel · Issue #12019 · jupyterlab/jupyterlab · GitHub](https://github.com/jupyterlab/jupyterlab/issues/12019)

The configuration can be found in the following JupyterLab API docs: [Application — JupyterLab Server 2.26.0 documentation](https://jupyterlab-server.readthedocs.io/en/stable/api/app.html)

The solution is to add the following line inside JupyterLab’s configuration file (e.g., `.jupyter/jupyter_lab_config.py`):

```auto
# Whether a notebook should start a kernel automatically
c.LabServerApp.notebook_starts_kernel = False

```

* * *

In addition, I have removed the default kernel.

First by using the following command (e.g., in the `postBuild` file):

```auto
# Remove kernels
jupyter kernelspec remove -y python3

```

Then by using the Notebook/Server configuration below (e.g., `.jupyter/jupyter_notebook_config.py` or `.jupyter/jupyter_server_config.py`):

```auto
# If there is no Python kernelspec registered and the IPython
# kernel is available, ensure it is added to the spec list
c.KernelSpecManager.ensure_native_kernel = False

```

source: [jupyter notebook - Jupyterlab: How to remove/hide default "Python 3" Kernel? - Stack Overflow](https://stackoverflow.com/questions/65954044/jupyterlab-how-to-remove-hide-default-python-3-kernel)

docs: [Config file and command line options — Jupyter Server documentation](https://jupyter-server.readthedocs.io/en/latest/other/full-config.html)
