Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

If you build your own conda environment which contains a python jupyter kernel (package ipykernel) you can make it visible to the jupyter hub by creating a kernel spec filekernelspec files. For a user the spec files are located in ~/.local/share/jupyter/kernels/ with a sub-directory for each spec. The kernel.json is the one that contains which python to use and the name the kernel will be shown in Jupyter (display_name) in a spec directory contains the settings. For an example see  ~wilko/.local/share/jupyter/kernels/example/.

...

Code Block
languagebash
% conda activate <your-env>%env>
% ipython kernel install --user --name "example"  a-name-displayyou-name "A-example"like"

The --name option is the name for the kernelspec - the directory that will be created in ~Jupyter finds the user kernels in the directory ~/.local/share/jupyter/kernels/.   To see how a kernel is setup look at the files in: /reg/g/psdm/sw/conda/jhub_config/prod-rhel7/kernels/.  Wilko also has an example here~wilko/.local/share/jupyter/kernels/tst1/There are a few more install options - ipython kernel install -h - the most useful one is --display-name  that allows to set the name shown in Jupyter. Instead of using the command above one can also create the directory and the kernel.json file by hand.

Virtualenv

NOTE: the virtualenv method is not compatible with our anaconda-based psana, but we leave the documentation here in case it is useful at some point.

...