# Extension shows up as both installed and uninstalled and doesn't work

**URL:** <https://discourse.jupyter.org/t/extension-shows-up-as-both-installed-and-uninstalled-and-doesnt-work/2688>\
**Category:** JupyterLab\
**Created:** [November 14, 2019, 2:52pm UTC](https://discourse.jupyter.org/t/extension-shows-up-as-both-installed-and-uninstalled-and-doesnt-work/2688 "2019-11-14T14:52:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaneselvans](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/zaneselvans/32/961_2.png) [@zaneselvans](https://discourse.jupyter.org/u/zaneselvans)\
**Post date:** [November 14, 2019, 2:52pm UTC](https://discourse.jupyter.org/t/extension-shows-up-as-both-installed-and-uninstalled-and-doesnt-work/2688/1 "2019-11-14T14:52:53Z")

</div>

Somehow I seem to have gotten my installed extensions into a not entirely working and/or internally inconsistent state, in particular the jupyterlab-vim extension is showing up as installed/enabled and OK… but also under “Uninstalled core extensions.” when I do jupyter labextension list:

```
JupyterLab v1.2.3
Known labextensions:
   app dir: /home/zane/miniconda3/envs/pudl-dev/share/jupyter/lab
        @jupyterlab/toc v1.0.1 enabled OK
        jupyterlab_vim v0.11.0 enabled OK
        nbdime-jupyterlab v1.0.0 enabled OK

Uninstalled core extensions:
    jupyterlab_vim

```

It also shows up in the extension manager sidebar, as installed & enabled. However, Jupyterlab behaves as if the extension is not installed at all – the functionality that it is supposed to provide is not available.

However, if I uninstall it, things break – the extension manager sidebar turns into a Server Error 500 message, and when I do jupyter labextension list I get:

```
JupyterLab v1.2.3
Known labextensions:
   app dir: /home/zane/miniconda3/envs/pudl-dev/share/jupyter/lab
        @jupyterlab/toc v1.0.1 enabled OK
        nbdime-jupyterlab v1.0.0 enabled OK

Uninstalled core extensions:
    jupyterlab_vim
An error occured.
KeyError: 'jupyterlab_vim'
See the log file for details: /tmp/jupyterlab-debug-pfpcdzp9.log

```

The logfile contains:

```
Yarn configuration loaded.
   app dir: /home/zane/miniconda3/envs/pudl-dev/share/jupyter/lab
        @jupyterlab/toc v1.0.1 enabled OK
        nbdime-jupyterlab v1.0.0 enabled OK
Traceback (most recent call last):

  File "/home/zane/miniconda3/envs/pudl-dev/lib/python3.7/site-packages/jupyterlab/debuglog.py", line 47, in debug_logging
    yield

  File "/home/zane/miniconda3/envs/pudl-dev/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 93, in start
    ans = self.run_task()

  File "/home/zane/miniconda3/envs/pudl-dev/lib/python3.7/site-packages/jupyterlab/labextensions.py", line 239, in run_task
    app_dir=self.app_dir, logger=self.log, core_config=self.core_config))

  File "/home/zane/miniconda3/envs/pudl-dev/lib/python3.7/site-packages/jupyterlab/commands.py", line 515, in list_extensions
    return handler.list_extensions()

  File "/home/zane/miniconda3/envs/pudl-dev/lib/python3.7/site-packages/jupyterlab/commands.py", line 728, in list_extensions
    messages = self.build_check(fast=True)

  File "/home/zane/miniconda3/envs/pudl-dev/lib/python3.7/site-packages/jupyterlab/commands.py", line 760, in build_check
    new_package = self._get_package_template(silent=fast)

  File "/home/zane/miniconda3/envs/pudl-dev/lib/python3.7/site-packages/jupyterlab/commands.py", line 1241, in _get_package_template
    data['jupyterlab']['mimeExtensions'].pop(item)

KeyError: 'jupyterlab_vim'

Exiting application: jupyter

```

I created a new jlab-test environment and installed just jupyterlab and the Vim extension, and in that context, it works fine. So I don’t think the problem is with the extension, but rather with this inconsistent installation state – is there some way to clean up the installed extension environment and get it back to a pristine state?

---

<div class="post-metadata">

**Author:** ![yuko-hi](https://avatars.discourse-cdn.com/v4/letter/y/7ea924/32.png) [@yuko-hi](https://discourse.jupyter.org/u/yuko-hi)\
**Post date:** [December 4, 2019, 2:32am UTC](https://discourse.jupyter.org/t/extension-shows-up-as-both-installed-and-uninstalled-and-doesnt-work/2688/2 "2019-12-04T02:32:41Z")

</div>

Hi, I also have the same problem as you met.

As the result I investigated the structure of my dir and files, it seems that there is a log file(~.venv\share\jupyter\lab\settings\build\_config.json, this is the case of my environment) in which uninstalled extension lists are registered.

After deleting a package-name: jupyterlab\_vim is maybe registered in your case, ‘’$ jupyter labextension list’’ works. But I don’t check whether ‘‘jupyter lab build’’ works. I’ll try it in the near future.

```auto
{
    "uninstalled_core_extensions": [
        "jupyterlab-chart-editor" <- package-name registered in my case(I deleted, and works)
    ]
}

```

---

<div class="post-metadata">

**Author:** ![asteppke](https://avatars.discourse-cdn.com/v4/letter/a/da6949/32.png) [@asteppke](https://discourse.jupyter.org/u/asteppke)\
**Post date:** [February 12, 2020, 12:37pm UTC](https://discourse.jupyter.org/t/extension-shows-up-as-both-installed-and-uninstalled-and-doesnt-work/2688/3 "2020-02-12T12:37:12Z")

</div>

I encountered a similar problem here. I wanted to update the matplotlib widget but first uninstalled the extension. This got listed in the aforementioned json file. After reinstalling the matplotlib widget the state of jupyter lab look as follows:

```
JupyterLab v1.2.6
Known labextensions:
   app dir: C:\Miniconda3\envs\jupyter\share\jupyter\lab
        @jupyter-widgets/jupyterlab-manager v1.1.0 enabled ok
        @jupyterlab/toc v1.0.1 enabled ok
        @ryantam626/jupyterlab_code_formatter v1.1.0 enabled ok
        jupyter-matplotlib v0.5.0 enabled ok
        jupyterlab-flake8 v0.4.1 enabled ok
        jupyterlab-jupytext v1.1.0 enabled ok

Uninstalled core extensions:
    jupyter-matplotlib

```

The matplotlib widget failed to load, rebuilding or reinstallation did not change the situation. Manually deleting the .json file lead to jupyter recognizing that a rebuild is required.

```
JupyterLab v1.2.6
Known labextensions:
   app dir: C:\Miniconda3\envs\jupyter\share\jupyter\lab
        @jupyter-widgets/jupyterlab-manager v1.1.0 enabled ok
        @jupyterlab/toc v1.0.1 enabled ok
        @ryantam626/jupyterlab_code_formatter v1.1.0 enabled ok
        jupyter-matplotlib v0.5.0 enabled ok
        jupyterlab-flake8 v0.4.1 enabled ok
        jupyterlab-jupytext v1.1.0 enabled ok

Build recommended, please run `jupyter lab build`:
    jupyter-matplotlib needs to be included in build

```

After the rebuild everything worked again. So I think this is definitely a bug.

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [March 16, 2020, 2:50am UTC](https://discourse.jupyter.org/t/extension-shows-up-as-both-installed-and-uninstalled-and-doesnt-work/2688/4 "2020-03-16T02:50:23Z")

</div>

I got a user report this on three extensions: [https://github.com/krassowski/jupyterlab-lsp/issues/203#issuecomment-599300121](https://github.com/krassowski/jupyterlab-lsp/issues/203#issuecomment-599300121). Did anyone open an issue on GitHub already?

---

<div class="post-metadata">

**Author:** ![krassowski](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/krassowski/32/1685_2.png) [@krassowski](https://discourse.jupyter.org/u/krassowski)\
**Post date:** [March 30, 2020, 5:52pm UTC](https://discourse.jupyter.org/t/extension-shows-up-as-both-installed-and-uninstalled-and-doesnt-work/2688/5 "2020-03-30T17:52:16Z")

</div>

Here is the GitHub issue: [https://github.com/jupyterlab/jupyterlab/issues/8122](https://github.com/jupyterlab/jupyterlab/issues/8122). Removing `build_config.json` worked for me.

---

<div class="post-metadata">

**Author:** ![alex\_baharov](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/alex_baharov/32/2931_2.png) [@alex\_baharov](https://discourse.jupyter.org/u/alex_baharov)\
**Post date:** [October 22, 2020, 8:45pm UTC](https://discourse.jupyter.org/t/extension-shows-up-as-both-installed-and-uninstalled-and-doesnt-work/2688/6 "2020-10-22T20:45:55Z")

</div>

it worked for me. Thank you !!! I was looking for a solution for a while.
