Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add python 3.6 kernel alongside 3.5 on jupyter

I am trying to test some code on Python 3.6 but my system default python version is python 3.5 I have installed python 3.6 and have tried to follow the jupyter documentation to install a new python kernel

python3.6 -m pip install ipykernel
python3.6 -m ipykernel install --user

But it didn't work since it continues to show a single kernel in the menu: Python3

Has anyone managed to have both 3.5 and 3.6 in the same jupyter installation?

like image 739
fccoelho Avatar asked May 03 '17 12:05

fccoelho


People also ask

How do I change the kernel version of a Python in Jupyter Notebook?

Open the Python Notebook and click on " Kernel " from the menu bar located on top of the python notebook. Click on " Change kernel " from the drop down box that appears and chose the version that is required.


1 Answers

one option is to create a kernel that you can use in jupyter notebook. enter image description here

you can do this inside the virtual environment:

  1. Open up your terminal and enter the following line by line

    virtualenv -p python3.6 py_36_env

    source py_36_env/bin/activate

    pip install ipykernel

    python -m ipykernel install --user --name=py_36_env

    jupyter notebook

  2. Then in jupyter notebook you can select the 3.6 environment (py_36_env) from the 'New' drop down menu shown above or from the 'Kernel' drop down menu within a given jupyter notebook.

like image 188
Lauren Avatar answered Oct 07 '22 00:10

Lauren