4

May I ask how to change the kernel display name from Python [defaul] to Python 2.7.12 for example?

I've been trying to modify the kernel.json file, particularly chaning the "display_name" from Python 2 to Python 2.7.12 But whenever I reopen the user interface through command ipython notebook, it never changes to what I want.

enter image description here

To clarify the possible duplicate with previous question: I did try what it suggests to do as I describe in the question. Unfortunately, it just doesn’t work. It would be nice if someone who does make this change successfully could share how they do

Jason
  • 3,166
  • 3
  • 20
  • 37
  • Possible duplicate of [Jupyter Kernel : Is there a way to rename them?](https://stackoverflow.com/questions/45085233/jupyter-kernel-is-there-a-way-to-rename-them) – Vivek Kalyanarangan Feb 24 '18 at 08:14
  • I did try what it suggests to do as I describe in the question. Unfortunately, it just doesn’t work. It would be nice if someone who does make this change successfully could share how they do. – Jason Feb 24 '18 at 08:19
  • What errors do you get? Why do you say it is not working. Please give more information. – vumaasha Feb 24 '18 at 08:23
  • Thanks for responding. Not working means that after I changed the kernel file (particularly "display_name"), whenever I reopen the jupyter notebook, the display name of the python doesn't change. – Jason Feb 28 '18 at 18:02

2 Answers2

4

I use Linux Mint 17. From a terminal I ran:

jupyter kernelspec list

I have a Python 2 kernel listed:

  python2        /home/matthew/.local/share/jupyter/kernels/python2

I edited the file:

/home/matthew/.local/share/jupyter/kernels/python2/kernel.json

Changing line 2 from:

 "display_name": "Python 2",

To:

"display_name": "Python 2 test",  

I killed the jupyter notebook tabs in chrome, then stopped and restarted the jupyter notebook server.

Now, instead of seeing 'Python 2' as the kernel name, I see 'Python 2 test'.

Hope this helps.

Oppy
  • 2,662
  • 16
  • 22
  • Thanks. And the reason I failed previously, even following your instruction, is that my Anaconda has some corrupt files that my anaconda navigator couldn't be opened. Now I reinstall anaconda, your suggestion actually works well. – Jason Mar 19 '18 at 07:06
0

OK,I don't know how you add the kernel. I add the kernel like this, and it does work. first, make sure you have installed ipykernel; then run the command:

python -m ipykernel install --name kernelname

KyChen
  • 59
  • 4