Adding Python 3 Kernel to Jupyter
when Python 2 won’t cut it anymore
Recently, I have been increasingly using Python 3 for some projects at work as well as some personal endeavors. I have been loyally using Python 2, as a habit retained from the first time I learned Python. I have the Anaconda distribution installed on all Macs I touch, so to be able to switch between 2 and 3, the task became adding Python 3 to Jupyter and enabling coding in notebooks with the kernel of choice.
What Worked
Basically these 4 lines in Terminal did it for me:
python2 -m pip install ipykernel
python2 -m ipykernel install --user
python3 -m pip install ipykernel
python3 -m ipykernel install --user
Result
I am now able to select which kernel to use when creating a new notebook
And, I can switch kernel while editing a notebook
Credit to Jana @ Stackoverflow.