Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to tell which kernel a jupyter notebook was built with?

I have multiple kernels installed in Jupyter. without fully starting Jupyter in a browser I'd like to know which version of Python or Julia or R was used to create the notebook. is there a way to query the ipynb file using command line?

How to know which is running in Jupyter notebook? discusses how to change kernels. I'd like to be able just to interrogate the notebook.

like image 721
ShpielMeister Avatar asked Dec 15 '17 22:12

ShpielMeister


People also ask

Which kernel is used in Jupyter Notebook?

The Jupyter team maintains the IPython project which is shipped as a default kernel (as ipykernel) in a number of Jupyter clients. Many other languages, in addition to Python, may be used in the notebook.

Does each Jupyter Notebook have its own kernel?

Each notebook kernel has its own Spark driver and set of Spark executors. No resources are shared.

What is Jupyter Notebook built on?

Jupyter Notebook is built using several open-source libraries, including IPython, ZeroMQ, Tornado, jQuery, Bootstrap, and MathJax. A Jupyter Notebook document is a browser-based REPL containing an ordered list of input/output cells which can contain code, text (using Markdown), mathematics, plots and rich media.


1 Answers

As @Georgy said, you can use jq, ie.:

ismael-vc@toybox ~/Downloads % cat Untitled.ipynb | jq '.metadata.kernelspec'
{
  "display_name": "Julia 0.6.0",
  "language": "julia",
  "name": "julia-0.6"
}
like image 148
HarmonicaMuse Avatar answered Oct 02 '22 20:10

HarmonicaMuse