How to add conda environment to jupyter lab

Assuming your conda-env is named cenv, it is as simple as :

$ conda activate cenv           # . ./cenv/bin/activate in case of virtualenv
(cenv)$ conda install ipykernel
(cenv)$ ipython kernel install --user --name=<any_name_for_kernel>
(cenv)$ conda deactivate

If you restart your jupyter notebook/lab you will be able to see the new kernel available. For newer versions of jupyter kernel will appear without restarting the instance. Just refresh by pressing F5.

PS: If you are using virtualenv etc. the above steps hold good.

Leave a Comment