hydroshare / hydroshare-jupyterhub

The HydroShare Jupyterhub Notebook Server is an environment designed provide added value to existing HydroShare resources via interactive computational notebooks.
4 stars 6 forks source link

Enabling user-created conda kernels in Jupyter #117

Open rsignell-usgs opened 6 years ago

rsignell-usgs commented 6 years ago

It would be great to allow HydroShare JupyterHub users to create their own conda environments and to enable these to appear in the list of available kernels in Jupyter.

I opened a terminal edited my $HOME/.condarc to specify an additional directory for environments:

channels:
  - odm2
  - landlab
  - conda-forge
  - defaults
envs_dirs:
  - /home/jovyan/my-conda-envs/

then created a new environment widgets.

It shows up when I do conda info -e: 2018-02-06_10-20-45

but it doesn't appear in the kernel list in Jupyter: 2018-02-06_10-21-59

I think you just need to add nb_conda_kernels to the root conda environment so that custom environments created by users will appear.

rsignell-usgs commented 6 years ago

If you are using repo2docker as described here you should be able to just add nb_conda_kernels to the environment.yml like:

$more environment.yml
name: root
channels:
  - conda-forge
  - defaults
dependencies:
  - python=3.6
  - jupyterhub
...
  - ulmo
  - nb_conda_kernels

See also: http://repo2docker.readthedocs.io/en/latest/usage.html#using-repo2docker-with-a-jupyterhub

Is that about right @yuvipanda?

Castronova commented 6 years ago

@rsignell-usgs I'll see if can implement this in the next JH release.