Parallel install of JupyterLab and Jupyter?

225 views
Skip to first unread message

Rob Russell

unread,
Nov 14, 2017, 7:01:55 PM11/14/17
to Project Jupyter
Hi - I'm trying to determine if jupyterlab is designed to run side-by-side or in parallel with Jupyter on the same port such that I could easily switch between the two by simply changing the url from <domain>/tree to <domain>/lab.

I did find this previously-asked question:
https://groups.google.com/forum/#!searchin/jupyter/parallel$20install$20jupyterlab|sort:date

Which seems to touch on it but I was left still wondering (and it's an old thread).

I was able to install jupyterlab locally and start it up using "jupyter lab" and I was also able to start up jupyter by running "jupyter notebook --port 8889" and it seemingly worked.

The hard part seems to be when instrumenting a Ubuntu Docker image with a root user and a less privileged user.  The Jupyterlab readme said, "Note: If installing using pip install --user, you must add the user-level bin directory to your PATH environment variable in order to launch jupyter lab.
I guess I need a bit more instruction to make this work.  What is the user-level bin directory?

I've tried
jupyter serverextension enable --py jupyterlab --sys-prefix
AND
jupyter serverextension enable --py jupyterlab

but I would see errors such as:
Error executing Jupyter command 'lab': [Errno 2] No such file or directory

after running "jupyter lab" from a bash shell in the Docker container.

Thanks for any pointers or tips,
Rob
I'm using Python 3.6.2 & IPython 4.2.1, notebook server is 4.4.1

Matthias Bussonnier

unread,
Nov 14, 2017, 7:32:35 PM11/14/17
to jup...@googlegroups.com
Hi Rob

> jupyterlab is designed to run side-by-side or in parallel with Jupyter

I think that by "jupyter" you mean Notebook , which we also refer to
as "classic Notebook", we tend to think of "Jupyter" as a set of
tools, JupyterLab is part of Jupyter.

Anyway, the answer is yes. You have nothing particular to do, you do
not even need to start a second server.
If you start the classic notebook, simply change /tree or /notebook by
/lab in the URL.

If you are running lab, click on "Help" > "Launch classic notebook".
Or you can also change the URL, but the menu item is there.

While the two can run at the same time, we sill recommend not opening
the same document at the same time in both.

You can have a look at this binder:
https://github.com/binder-examples/jupyterlab

where this work flawlessly without having to do anything in particular.

Let us know if that does not work
--
M
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to jupyter+u...@googlegroups.com.
> To post to this group, send email to jup...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jupyter/142bc72d-838e-4fd3-beec-05b614403872%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Rob Russell

unread,
Nov 15, 2017, 4:45:41 PM11/15/17
to Project Jupyter
Thank you, Matthias.

This was very helpful.  I didn't understand that I didn't have to launch a separate server instance.

I also figured out a couple things:
When you use the `conda install` route a file is created to tell jupyter what extensions to enable.  This file is located here:
/anaconda/etc/jupyter/jupyter_notebook_config.json

However, we are configuring our Docker image to have a root user and a less privileged user.  This means that our existing jupyter_notebook_config.json is located here for our intended Jupyter/Notebook user:
/home/non_root_user/.jupyter/jupyter_notebook_config.json

So, if you use conda to install jupyterlab (without any allowances for updating the proper/user Notebook config file) it will essentially be misconfigured.

So to solve this I used the following in my Docker file:
USER ${NOT_ROOT_USER}
RUN pip install jupyterlab==${jupyter_lab_version}
# Install extensions and kernels - as non root user
USER ${NOT_ROOT_USER}
RUN jupyter serverextension enable --py jupyterlab --user # not --sys-prefix

Notice that this deviates from the official Jupyterlab README in so far as I don't use "--sys-prefix" (I can't easily find the documents to explain what --sys-prefix does exactly)

Thanks again and I hope this helps someone else.

Matthias Bussonnier

unread,
Nov 15, 2017, 6:10:22 PM11/15/17
to jup...@googlegroups.com
Great !

Happy to have this solved for you. 
The configuration issue is weird, though I rarely install stuff as root; there should be way to have system wide config, but I don't remember from the top of my head. 

I'm also guessing your first "USER ${NOT_ROOT_USER}" is meant to be "USER ${ROOT}", otherwise you install all as non-privilege user :-) 

Thanks for looking into that in details.

Just a an extra precision, the timeline for _notebook server_ should be something like that. 

a) installing the notebook server installs "classic notebook", while  "Lab" is an extension.
b) installing the notebook server installs both "classic notebook", and  "Lab" always.
c) installing the notebook server installs "Lab", and  "Classic" is now an extension.

And again thanks for trying Lab before it is released ! If you have ideas on how to make the docs clearer feel free to open issues or send pull-requests !
-- 
Matthias



To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.

To post to this group, send email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages