Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Select Kernel" Does not Use kernelspec Information #15074

Open
ericspod opened this issue Sep 4, 2023 · 5 comments
Open

"Select Kernel" Does not Use kernelspec Information #15074

ericspod opened this issue Sep 4, 2023 · 5 comments
Labels

Comments

@ericspod
Copy link

ericspod commented Sep 4, 2023

Description

When a notebook is opened without a kernel (eg. if notebook_starts_kernel = False) and a cell is run, the "Select Kernel" dialog comes up. If the notebook was previously run with a kernel, information about it will be stored in the kernelspec section of the notebook's metadata. When this notebook is run again the dialog box comes up again even if the kernelspec data is present and would have caused a kernel to be created correctly if notebook_starts_kernel was True.

Reproduce

  1. Create a new notebook
  2. Select kernel for notebook
  3. Run cell within notebook
  4. Save and close notebook
  5. Kill notebook kernel
  6. Reopen notebook without kernel (eg. with notebook_starts_kernel = False)
  7. Rerun cell
  8. "Select Kernel" should appear

Expected behavior

If a notebook previous run with a valid kernel is reopened and run, it should choose a kernel if possible given the kernelspec data and only bring up the "Select Kernel" dialog if necessary.

What I'd like to be able to do is open and close notebooks just to read or check their contents without starting kernels. This is to reduce clutter but also not open a notebook multiple times if I've accessed Jupyter through multiple browsers or browser tabs. When I do want to run a kernel it would be a little more usable to not see the "Select Kernel" dialog when I don't need to. If I wouldn't see this dialog when a kernel starts automatically on notebook opening, I shouldn't see it when running a cell in a notebook that didn't have a kernel running yet.

Context

  • Operating System and version: Linux Ubuntu 20.04
  • Browser and version: Firefox 117
  • JupyterLab version: 3.6.3
Troubleshoot Output
Paste the output from running `jupyter troubleshoot` from the command line here.
You may want to sanitize the paths in the output.
Command Line Output
Paste the output from your command line running `jupyter lab` here, use `--debug` if possible.
Browser Output
Paste the output from your browser Javascript console here, if applicable.
@ericspod ericspod added the bug label Sep 4, 2023
@welcome
Copy link

welcome bot commented Sep 4, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Sep 4, 2023
@krassowski
Copy link
Member

If I am reading it correctly, this appears to have been fixed by #12858 which was included in JupyterLab 4.0. Can you take a look at that PR/try the new version to confirm?

@ericspod
Copy link
Author

ericspod commented Sep 4, 2023

Hi @krassowski thanks for looking into this. I just ran the test with version 4.0.5 and it behaves still as I described. I see the preferred kernel option now but I would still expect that the kernel named in the kernelspec would be used automatically and the dialog wouldn't come up still.

If I re-enable notebook_starts_kernel (the default) and restart Jupyterlab, when I open the same notebook I'm not asked for a kernel since the correct one starts automatically. What I'd like is for this kernel that's automatically started to be only started when I try to run a cell for the first time.

@krassowski
Copy link
Member

In version 4.0.5 did you enable autoStartDefaultKernel in settings? There should also be a checkbox in the dialog shown when attempting to run a cell.

@ericspod
Copy link
Author

ericspod commented Sep 5, 2023

I didn't set autoStartDefaultKernel but I do see the checkbox in the dialog. I think this is a separate bit of functionality though, before this was added a notebook could still figure out what kernel to start without this default being set and that's what I'd like to happen when I run a cell for the first time with a notebook having no kernel yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants