Skip to content

Jupyter notebook written using VSCode makes build crash with NoSuchKernel error #314

@ksachdeva

Description

@ksachdeva

A notebook authored using VSCode built-in editor fails to build.

Steps to reproduce the behavior:

  • Use VSCode built-in editor/support to write your Jupyter Notebook
  • Make sure to execute at least one cell in VSCode
  • Issue jupyter-book build .

This results in build failing with an exception/error - "NoSuchKernel ..." Here is a trace of the error stack

image

Environment

  • Python Version 3.7.8 in virtualenv
  • Package versions : jupyter-book 0.8.2
  • Operating System: macOS
  • IDE: VSCode

Workaround

Here is how I work around this issue-

Open the notebook in raw mode (i.e. json file) and remove kernelspec section. For e.g.

I go to the location where I have below shown json blob

"orig_nbformat": 2,
  "kernelspec": {
   "name": "Python 3.7.8 64-bit ('prmlenv': venv)",
   "display_name": "Python 3.7.8 64-bit ('prmlenv': venv)",
   "metadata": {
    "interpreter": {
     "hash": "ec5a04176abb2f15087dd010db8344c4d46cfabf8263c1804b67e1f772428e7e"
    }
   }
  }

I then delete the whole kernelspec

This makes jupyter-book build happy.

Needless to say, it adds/introduces an extra step for me per notebook.

I am not sure if it is VSCode at fault here or jupyter-book is not able to find the appropriate kernel. Note that both use the same virtualenv.

Regards
Kapil

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions