# JupyterLab concept

**URL:** <https://discourse.jupyter.org/t/jupyterlab-concept/15868>\
**Category:** JupyterLab\
**Tags:** jupyterhub\
**Created:** [September 20, 2022, 2:01pm UTC](https://discourse.jupyter.org/t/jupyterlab-concept/15868 "2022-09-20T14:01:13Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zbynek](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zbynek](https://discourse.jupyter.org/u/zbynek)\
**Post date:** [September 20, 2022, 2:01pm UTC](https://discourse.jupyter.org/t/jupyterlab-concept/15868/1 "2022-09-20T14:01:13Z")

</div>

## Facts:

We have a centralized Python which is not writable for users. This installation has Jupyter Lab installed. Users login to RStudio and pick the JupyterLab to start a Jupyter session. In the session I can see only the basic set of extensions installed. The rest is to “Discover”.  
Users also have their own Python virtual environments in their “~/venv” directory should they wish to code in Python. The env is actually a clone of the centralized Python installation.

## Situation.

I was able to install a set of other extensions using the “~/venv/bin/jupyter-labextension install” command. The “~/venv/bin/jupyter-labextension list” shows a list of the new extensions in its output, but these extensions are NOT displayed in the “Installed” section of the session started by me out of the RStudio Web UI. I have my point of view of this implementation, but I’d like to compare to your experience and understanding.

## Question 1

I wonder if “our” concept all is the correct approach to offer an extended behavior of the Jupyter Lab than just the basic.

## Question 2

Is there a way to tell the “/centralized/Python/bin/jupyter lab” to read the extensions the user installs?

Thank you

---

<div class="post-metadata">

**Author:** ![bollwyvl](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bollwyvl/32/904_2.png) [@bollwyvl](https://discourse.jupyter.org/u/bollwyvl)\
**Post date:** [September 20, 2022, 2:35pm UTC](https://discourse.jupyter.org/t/jupyterlab-concept/15868/2 "2022-09-20T14:35:07Z")

</div>

You could try launching with [extra\_labextensions\_path](https://jupyterlab-server.readthedocs.io/en/latest/api/app.html#jupyterlab_server.app.LabServerApp.extra_labextensions_path) configured.

This can be specified at the CLI:

```bash
jupyter lab --LabConfig.extra_labextensions_path=/home/user1/venv/share/jupyter/labextensions

```

or in `jupyter_server_config.json`:

```json
{
  "LabConfig": {
    "extra_labextensions_path": [
      "/home/user1/venv/share/jupyter/labextensions"
    ]
  }
}

```

Of note: this may _still_ result in weird breakage, depending on what else your users do. For example, labextensions with serverextensions (e.g. `jupyterlab-git` or `jupyterlab-lsp`) won’t have their REST APIs available. Conservative ones _generally_ don’t wedge the system, and have some kind of fallback… but you never know.

---

<div class="post-metadata">

**Author:** ![zbynek](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zbynek](https://discourse.jupyter.org/u/zbynek)\
**Post date:** [September 20, 2022, 3:07pm UTC](https://discourse.jupyter.org/t/jupyterlab-concept/15868/3 "2022-09-20T15:07:36Z")

</div>

## We want to be careful and let users install only lab extensions for starters.

~/venv/bin/jupyter-labextension install @jupyterlab/toc

> > Installed OK

~/venv/bin/jupyter labextension list returns, among the default:  
@jupyterlab/toc v5.4.7 enabled OK

Executing:  
/path/to/os\_wide/Python/3.9.1/bin/jupyter-lab --no-browser --allow-root --ip=0.0.0.0 --LabConfig.extra\_labextensions\_path=/home/userxyz/venv/share/jupyter/labextensions

## Result:

The “@jupyterlab/toc” is not in the “Installed”.

---

<div class="post-metadata">

**Author:** ![bollwyvl](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bollwyvl/32/904_2.png) [@bollwyvl](https://discourse.jupyter.org/u/bollwyvl)\
**Post date:** [September 20, 2022, 5:37pm UTC](https://discourse.jupyter.org/t/jupyterlab-concept/15868/4 "2022-09-20T17:37:14Z")

</div>

My bad, it looks like `labextensions` is appended; try removing that leaving just `/home/userxyz/venv/share/jupyter`.

---

<div class="post-metadata">

**Author:** ![zbynek](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zbynek](https://discourse.jupyter.org/u/zbynek)\
**Post date:** [September 21, 2022, 7:21am UTC](https://discourse.jupyter.org/t/jupyterlab-concept/15868/5 "2022-09-21T07:21:44Z")

</div>

> [@zbynek](#):
>
> Python/3.9.1/bin/jupyter-lab --no-browser --allow-root --ip=0.0.0.0 --LabConfig.extra\_labextensions\_path=/home/userxyz/venv/share/jupyter

Sorry. No success.

Upper = OS Wide  
Lower = venv

 ![os_wide-venv_2022-09-21 08_51_07-Window](https://canada1.discourse-cdn.com/flex031/uploads/jupyter/original/2X/3/3c00611ede889eb85c7589b1fdbd6ff746b750d5.png)

---

<div class="post-metadata">

**Author:** ![bollwyvl](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/bollwyvl/32/904_2.png) [@bollwyvl](https://discourse.jupyter.org/u/bollwyvl)\
**Post date:** [September 21, 2022, 1:24pm UTC](https://discourse.jupyter.org/t/jupyterlab-concept/15868/6 "2022-09-21T13:24:03Z")

</div>

One could try the [`$JUPYTER_PATH` environment variable](https://jupyter-core.readthedocs.io/en/latest/paths.html#jupyter_core.paths.jupyter_path) (and perhaps `$JUPYTER_PREFER_ENV_PATH`, i’m not sure how they would play out for this specific use case)… again, potentially disasterously, as there are a few extensions shown there that have serverextensions and kernel packages that need to match _exactly_.

Also, most `jupyter` subcommands support a `--debug` flag that will tell more about your config environment when launching. Running your test cases with these might help them reveal more things.

Also, every time I see `--allow-root` and `0.0.0.0`, i get a little sad, as these are a great way to open an app up to serious issues.

---

<div class="post-metadata">

**Author:** ![zbynek](https://avatars.discourse-cdn.com/v4/letter/z/c0e974/32.png) [@zbynek](https://discourse.jupyter.org/u/zbynek)\
**Post date:** [September 21, 2022, 1:39pm UTC](https://discourse.jupyter.org/t/jupyterlab-concept/15868/7 "2022-09-21T13:39:30Z")

</div>

Good. I’ll test.  
The `--allow-root` and `0.0.0.0` comes from the command shown in the processes as a sub-process of started jupyter session.
