Skip to content

Latest commit

 

History

History
57 lines (36 loc) · 1.53 KB

adding_jupyter_kernels.md

File metadata and controls

57 lines (36 loc) · 1.53 KB

Usually when installing new environments on clusters, the environment name automatically shows up on the available kernels. However, sometimes it does not. In situations it doesn't, some extra steps need to be taken, as noted below. Step 1-2 are the standard steps, then the magin happens.

That's some voodoo-magic right there. The method actually works quite well --

(replace instances of with your preferred name)

  1. Create your conda environment at the command line.

conda create --name ...

For this to work I needed the following modules:

$ conda create --name ipython jupyter

  1. Prepare your environment at the command line (varies by your default shell).

Bash:

$ source activate

T/csh:

$ setenv PATH ~$USER/.conda/envs//bin:$PATH

Make sure ipython is pointing to your newly created conda environment.

  1. Create a custom kernel

$ jupyter kernelspec install-self --user

  1. Rename the python kernel you created. This way it does not override the default python2.7 kernel.

$ cd ~/.local/share/jupyter/kernels $ vim /kernel.json

Change the display_name:

{

  • "display_name": "Python 2",
  • "display_name": "Python 2 ()", "language": "python", "argv": [ "/home/jsattelb/.conda/envs//bin/python", "-m", "ipykernel", "-f", "{connection_file}" ] }

Then rename the directory, as well...

$ mv python2

The next time you refresh your JupyterHub instance, you'll see your custom environment under New.