I had troubles using a fermitools environment in jupyterhub.
The main issue was that the jupyter kernel linked to the conda environment was not correctly setting all the environment variables necessary to run the fermitools.
I managed to solve the issue with this procedure:
Activate conda environment in a jupyterhub shell:
bash:~$ conda activate fermi
Modify the file $HOME/.local/share/jupyter/kernels/fermi/kernel.json
Replace the first argv item "/path/to/conda/envs/fermi/bin/python" with this line: "$HOME/.local/share/jupyter/kernels/fermi/kernel.sh"
As an alternative, after step 1 you can run the script attached :
bash:~$ ./setup_kernel_fermitools.sh <env_name>
For example:
bash:~$ ./setup_kernel_fermitools.sh fermi
I had troubles using a fermitools environment in jupyterhub. The main issue was that the jupyter kernel linked to the conda environment was not correctly setting all the environment variables necessary to run the fermitools. I managed to solve the issue with this procedure:
Activate conda environment in a jupyterhub shell:
bash:~$ conda activate fermi
Install kernel :
bash:~$ python -m ipykernel install --user --name=fermi
Create the kernel.sh file in the folder and make it executable: $HOME/.local/share/jupyter/kernels/fermi/kernel.sh
This is the content of the kernel.sh file:
Modify the file $HOME/.local/share/jupyter/kernels/fermi/kernel.json Replace the first argv item "/path/to/conda/envs/fermi/bin/python" with this line: "$HOME/.local/share/jupyter/kernels/fermi/kernel.sh"
Refresh jupyterhub and select fermitools kernel