davidrpugh
davidrpugh

Reputation: 4583

How to change the kernel name in Jupyter Notebook running on Windows?

I am experienced Python/Jupyter user, but a Windows newbie, after downloading and installing Anaconda Python 3 distribution and firing up a Jupyter notebook I noticed that the kernel for the Jupyter Notebook says Python[Root] (instead of Python 3 on Unix-based systems).

Notebook works fine, but sharing notebooks seems to be problematic as whenever a notebook created on my machine is opened on a non-Windows machine the user encounters a "cannot find Python[Root] kernel" message and is prompted to select Python 3 (or Python 2) kernel. This is annoying.

I do not seem to have the option of changing the kernel manually within the notebook. Perhaps this is an issue with how Anaconda (or Jupyter) is installed on my Windows machine?

Upvotes: 8

Views: 4843

Answers (2)

wombatonfire
wombatonfire

Reputation: 5430

If nb_conda_kernels package is not used (as in this case), the name of the kernel is taken from the kernel spec file. To find the the kernel spec use jupyter kernelspec list command:

(base) C:\Users\user>jupyter kernelspec list
Available kernels:
  python2    C:\Anaconda2\share\jupyter\kernels\python2

For each kernel there will be kernel.json file in the corresponding folder, where display_name can be changed:

{
 "display_name": "Python 2", 
 "language": "python", 
 "argv": [
  "C:\\Anaconda2\\python.exe", 
  "-m", 
  "ipykernel_launcher", 
  "-f", 
  "{connection_file}"
 ]
}

In my case it's a Python 2 environment, but the format is the same for Python 3.

Upvotes: 2

cameres
cameres

Reputation: 508

This is due to Anaconda's virtual environments'. The "Root" kernel that you see is from Anaconda's environment that is created upon installation. In order to install other kernels for various versions of python see http://ipython.readthedocs.io/en/stable/install/kernel_install.html.

Upvotes: 0

Related Questions