JupyterHub: "jupyter serverextension enable --py qiime2 --sys-prefix" does not work

Hi all,

I built the JupyterHub environment considering hosting a small teaching session. The QIIME 2 is isntalled in a separate conda env and it works well.
When an external user logs in to the JupyterHub and runs the visualization code such as the following, an error occurs.

demux_trimmed_summary_vis = qiime2.Visualization.load('./paired-end-demux-trimmed.qzv')

Install QIIME 2 Jupyter extension with:
jupyter serverextension enable --py qiime2 --sys-prefix
then restart your server.
(Interactive output not available on static notebook viewer services like nbviewer.)

I checked that the extension is enabled as follows.

Enabling: qiime2.jupyter
- Writing config: /opt/anaconda3/envs/microbiome/etc/jupyter
    - Validating...
      qiime2.jupyter  OK

However, after restarting the JupyterHub, the same error occurs.

One thing I couldn't understand is... if a user opens SSH (port 8888) through PuTTY and runs a jupyter notebook, the visualization works well without any errors. Therefore, I think this error is something to do with the JupyterHub. I'd appreciate any comments.


1 Like

Hi there @jaehyun.kim!

I have a feeling this is the problem - I think the server extension assumes that it is installed in the same conda environment as the jupyter server (although I don't know this for sure). Is it possible for you to run jupyter notebook from the same environment that has QIIME 2 installed in it?

Keep us posted :qiime2: :t_rex:

1 Like

Hi @thermokarst
Thank you for your comments. I tried to re-install everything within the same conda environment but again failed to load the serverextension.
After activating the conda environment (named microbiome and installed qiime2 and jupyter), I typed 'sudo /opt/anaconda3/envs/microbiome/bin/jupyterhub'.
I had to manually set up the path to the configurable-http-proxy, jupyterhub, etc.
But the PermissionError occurred and failed to load the jupyterhub.
I think it's something to do with root privilege, the path to the jupyter, and virtual environment settings.

After seeing those errors, I decided to roll back to the previous settings.
Anyway, users should be able to view their .qzv files through the q2view.

Thanks for your help!!


This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.