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

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?

2 Likes

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.

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