Activating JupyterLab in Qiime2

jupyter
(Laura Davies) #1

Hi,

Please can you provide details on how to run JupyterLab within Qiime2.

I have qiime2 2018-11 installed via conda. I activated my qiime2 environment and did a conda install of the JupyterLab packages (conda install -c conda-forge jupyterlab) and checked it was installed within the qiime2 env.

I tried to activate Jupyter by running

jupyter serverextension enable --py qiime2 --sys-prefix

But I received the error: “No module named qiime2”

I also tried
jupyter serverextension enable --py qiime2-2018.11 --sys-prefix

But received the same error.

Thanks for your help.
Laura

(Evan Bolyen) #2

Hi @laura.d!

That should have worked. Would you be able to run conda list inside your environment? I suspect something is not quite right.

Thanks and welcome to the forum!

(Laura Davies) #3

Hi Evan,

I ran conda list within the qiime env and jupyter is installed

Capture2

Cheers
Laura

(Matthew Ryan Dillon) #4

Hey there @laura.d, I suspect @ebolyen was actually looking for the complete output from conda list, that way we can get a closer look at QIIME 2 and friends.

:penguin:

1 Like
(Laura Davies) #5

Ah sorry!

(Laura Davies) #6

(Laura Davies) #7

#8

Hi!
After cd to your working directory and activating Qiime2, are you activating Jupyter lab by …?

conda activate jupyter lab

If you want to import Qiime after it before importing you should run inside of the jupyter

!jupyter serverextension enable --py qiime2 --sys-prefix

and restart jupyter

(Matthew Ryan Dillon) #9

Hi @timanix — you can’t/shouldn’t nest activated environments like this — all packages need to be in the same environment.

@laura.d, I just tried this in a clean, fresh 2019.4 environment:

~/Desktop
☻  conda activate qiime2-2019.4
(qiime2-2019.4)
~/Desktop
☻  conda install -c conda-forge jupyterlab
Collecting package metadata: done
Solving environment: done

## Package Plan ##

  environment location: /home/matthew/.conda/envs/qiime2-2019.4

  added / updated specs:
    - jupyterlab


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    jupyterlab-0.35.6          |           py36_0        10.5 MB  conda-forge
    jupyterlab_server-0.2.0    |             py_0          21 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        10.6 MB

The following NEW packages will be INSTALLED:

  jupyterlab         conda-forge/linux-64::jupyterlab-0.35.6-py36_0
  jupyterlab_server  conda-forge/noarch::jupyterlab_server-0.2.0-py_0

Proceed ([y]/n)?

Downloading and Extracting Packages
jupyterlab-0.35.6    | 10.5 MB   | ################################################################################################################################################################################################################################################# | 100%
jupyterlab_server-0. | 21 KB     | ################################################################################################################################################################################################################################################# | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
(qiime2-2019.4)
~/Desktop
☻  jupyter serverextension enable --py qiime2 --sys-prefix

Enabling: qiime2.jupyter
- Writing config: /home/matthew/.conda/envs/qiime2-2019.4/etc/jupyter
    - Validating...
      qiime2.jupyter  OK

Maybe just try again? Perhaps something went subtly wrong before…

:t_rex:

1 Like
(Laura Davies) #10

Thanks @thermokarst. I re-installed and although I could load the package, I still can’t connect to jupyter lab

Firefox automatically opens but just returns this blank page:

I tried manually typing the URL into Firefox and Chrome but it just returns to the http://localhost:8888/lab webpage.

Thanks again.

(Matthew Ryan Dillon) #11

Hi there @laura.d!

The QIIME 2 team isn’t involved in the development of jupyterlab, so you might be better off asking for help with the jupyter folks if you aren’t able to resolve this. My one suggestion is to copy the complete URL from your terminal (including the ?token=... business) into your browser (assuming you are running jupyterlab and the browser on the same computer — if not, then you will need to consult the jupyterlab docs to figure out a path forward).

1 Like
(Laura Davies) #12

Hi @thermokarst,
I have tried copying the complete URL but you’re right, I should contact the jupyter peeps.
Thanks for your help - you’re all brilliant! :partying_face:

2 Likes