Awhile back, I wrote a post about getting QIIME2 up and running with jupyterhub. I have never been able to get it running “out-of-the-box”. The issue that I am running into is that the PATH variable used by the single user notebooks is not the path that jupyter hub uses and so when a call to an exernal package is made the package will not be found.
I realize this is not an issue with QIIME, but rather with jupyterhub, however given the potential use of jupyterhub for classes or workshops (or companies) I wanted to post this in case anyone else has run into a similar issue or has found a solution.
One workaround I have found is to update the path from inside of the notebook where QIIME is being run:
import os
os.environ['PATH'] = '/home/jovyan/my-conda-envs/qiime2-2018.8/bin:' + os.environ['PATH']
That’s a good trick, although I still think the right approach is to create a custom spawner which generates new kernels for all of the user’s environments. Then the $PATH var can be set appropriately. (This can happen more or less dynamically).
create a custom spawner which generates new kernels for all of the user’s environments
This is actually what happens now. I don't think it is possible to point to the correct path unless the notebook is started from within the conda environment.