Conda environment as a Jupyter Notebook kernel

Conda Environment as a Jupyter Notebook kernel


Update conda

$ conda activate base
$ conda update -n base -c defaults conda
$ conda update --all -y

Add conda tensorflow environment

$ conda create -n py_36_tf python=3.6 tensorflow -y

List currently installed Jupyther kernels 



$ ls -alt ~/Library/Jupyter/kernels/


total 0
drwx------ 7 uki staff 224 Nov 22 11:50 ..
drwxr-xr-x 9 uki staff 288 Nov 22 11:43 .
drwxr-xr-x 5 uki staff 160 Nov 4 06:35 julia-1.4
drwxr-xr-x 5 uki staff 160 Apr 1 2020 python361064bitpy36condaa60168e76a7b4349b469299762ee4c30
drwxr-xr-x 5 uki staff 160 Apr 1 2020 python38264bitpytorchcondaaf5a833263b448b8b2738bb5a7355c8a
drwxr-xr-x 5 uki staff 160 Apr 1 2020 python361064bitturiconda565ecc262d0845fbb235ae21ac24296f



List conda environments you already created



$ conda info --envs

 

# conda environments:
#

/Users/uki/.julia/conda/3
base * /opt/anaconda3
py27 /opt/anaconda3/envs/py27
py36 /opt/anaconda3/envs/py36
py_36_tf /opt/anaconda3/envs/py_36_tf
pytorch /opt/anaconda3/envs/pytorch
tensorflow /opt/anaconda3/envs/tensorflow
turi /opt/anaconda3/envs/turi


Install new Jupyther kernel


$ python -m ipykernel install --user --name py_36_tf --display-name "Python 3.6 (tensorflow)"





Installed kernelspec py_36_tf in /Users/uki/Library/Jupyter/kernels/py_36_tf

Refresh a page with Jupyther Lab notebook and change to the new kernel.




Delete kernels that you want to replace


$ rm -r ~/Library/Jupyter/kernels/my_old_kernel_name