Using Javascript Kernel in Vscode Jupyter Notebooks
2021-04-07
I haven’t worked in python that much, but even I know about jupyter notebooks. They are great prototyping tool. And while python is the poster child of notebooks, you can actually run them with any language. One thing which looked great is the ability in VSCode to run notebooks directly. One issue though, I’m not a python developer and would love to use javascript kernel instead.
So, at the moment there is no official support for different kernels, BUT by accident I’ve realised it’s possible to still use id 🤯.
While not the most convenient way to do this, it’s pretty straightforward.
- Setup jupyter notebooks for your platform, I won’t get into details of this
as there is official documentation. In nutshell, you should be able to run
jupyter notebook
and get working notebook running in your browser. - Next part of this puzzle is the javascript kernel. Follow the ijavascript installation steps.
- Now start jupyter in your working directory
jupyter notebook
- Go to the url provided from CLI.
- Create a new notebook, with javascript kernel
- Now you can open the newly created notebook with VSCode. On macos with
vscode cli
code <notebook-name>.ipynb
- You can now stop the server from step 3.
If all went well, you should see notebook open and running similar to this
NOTE you might need to select the appropriate interpreter and trust
the
notebook. Also I needed restart of vscode after doing that.