question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Saving invalid kernelspec

See original GitHub issue

I’m simply re-raising issue #2423. I do not know why it was closed, nor why the conversation there was locked; no solution to the problem is given in that issue.

This is relevant for me because I’m using VSCode to edit Jupyter notebooks, then using Jupyter Book to compile those notebooks into a book. Since that uses nbconvert, the same problem arises.

But much more generally, the problem is rather serious, in that VSCode is setting kernelspecs that it seems only VSCode will ever be able to understand. It’s taking Jupyter notebooks that are usable by a huge variety of tools and secretly converting them to only being usable within VSCode (!?). If it needs to set the kernelspec to a secret giant hash that works only within VSCode, fine, go ahead and do that in memory, but why save that data to the filesystem? Obviously VSCode can recreate such hashes any time it opens the file, so it doesn’t have any actual need to change the kernelspec on disk, and doing so only destroys compatibility with every other notebook-related tool.

My current workflow is literally opening the .ipynb files in vim and manually fixing the metadata after I save it with VSCode, or alternatively opening up my SCM app and reverting those few lines manually after every save (!).

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
nathancartercommented, May 14, 2021

Ah, I see, I’m not on insiders at the moment. I can wait for it to propagate into the main build. Thank you for the very fast reply!

0reactions
DonJayamannecommented, May 19, 2021

Thanks for the confirmation, closing in favor of #5612

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jupyter Lab and Notebook Problem: Kernel Error
Solved the problem by editing the relevant kernelspec : kernel.json file after fresh installation of Anaconda. Solution in Detail.
Read more >
How to fix Kernel Error or broken Python in Jupyter Notebook
Save. 73K views 2 years ago. 73,132 views • Aug 26, 2020. TL;DW BELOW! If you delete or upgrade your python version, you...
Read more >
Making kernels for Jupyter — jupyter_client 7.4.8 documentation
Making kernels for Jupyter . A 'kernel' is a program that runs and introspects the user's code. IPython includes a kernel for...
Read more >
How to Fix Kernel Error in Jupyter Notebook
A kernel error occurs basically when you try opening a python 3 file in the wrong directory. The truth is Jupyter and Python...
Read more >
Troubleshooting Vertex AI Workbench - Google Cloud
Container images that do not have a valid kernelspec don't successfully load as ... Invalid service networking configuration error message ... Click Save....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found