plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Error listing extensions when plotly >=6.1.2 installed

Open achhina opened this issue 7 months ago • 1 comments

Hey folks, after installing the most recent release I'm seeing the following error when attempting to list extensions:

KeyError: 'packageManager'  not found inside install.json
$ jupyter labextension list --debug
Searching ['/Users/achhina/venvs/plotly-test/etc/jupyter', '/Users/achhina/.config/jupyter', '/usr/local/etc/jupyter', '/etc/jupyter'] for config files
Looking for jupyter_config in /etc/jupyter
Looking for jupyter_config in /usr/local/etc/jupyter
Looking for jupyter_config in /Users/achhina/.config/jupyter
Looking for jupyter_config in /Users/achhina/venvs/plotly-test/etc/jupyter
Looking for lab_config in /etc/jupyter
Looking for lab_config in /usr/local/etc/jupyter
Looking for lab_config in /Users/achhina/.config/jupyter
Looking for lab_config in /Users/achhina/venvs/plotly-test/etc/jupyter
Yarn configuration loaded.
JupyterLab v4.4.3
/Users/achhina/venvs/plotly-test/share/jupyter/labextensions
        jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
Traceback (most recent call last):

  File "/Users/achhina/venvs/plotly-test/lib/python3.13/site-packages/jupyterlab/debuglog.py", line 45, in debug_logging
    yield

  File "/Users/achhina/venvs/plotly-test/lib/python3.13/site-packages/jupyterlab/labextensions.py", line 169, in start
    ans = self.run_task()

  File "/Users/achhina/venvs/plotly-test/lib/python3.13/site-packages/jupyterlab/labextensions.py", line 425, in run_task
    list_extensions(
    ~~~~~~~~~~~~~~~^
        app_options=AppOptions(
        ^^^^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
        )
        ^
    )
    ^

  File "/Users/achhina/venvs/plotly-test/lib/python3.13/site-packages/jupyterlab/commands.py", line 580, in list_extensions
    return handler.list_extensions()
           ~~~~~~~~~~~~~~~~~~~~~~~^^

  File "/Users/achhina/venvs/plotly-test/lib/python3.13/site-packages/jupyterlab/commands.py", line 788, in list_extensions
    self._list_federated_extensions()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^

  File "/Users/achhina/venvs/plotly-test/lib/python3.13/site-packages/jupyterlab/commands.py", line 1759, in _list_federated_extensions
    extra += " ({}, {})".format(install["packageManager"], install["packageName"])
                                ~~~~~~~^^^^^^^^^^^^^^^^^^

KeyError: 'packageManager'

/Users/achhina/venvs/plotly-test/lib/python3.13/site-packages/jupyterlab/debuglog.py:54: UserWarning: An error occurred.
  warnings.warn("An error occurred.")
/Users/achhina/venvs/plotly-test/lib/python3.13/site-packages/jupyterlab/debuglog.py:55: UserWarning: KeyError: 'packageManager'
  warnings.warn(msg[-1].strip())
/Users/achhina/venvs/plotly-test/lib/python3.13/site-packages/jupyterlab/debuglog.py:56: UserWarning: See the log file for details: /var/folders/7d/6v1f4d011x7b9v6tbvw4x6480000gn/T/jupyterlab-debug-xcr2tdtu.log
  warnings.warn(f"See the log file for details: {log_path!s}")
Exiting application: lab

Looks to be related to the changes in #5096, and potentially mixing of source extensions with federated ones?

achhina avatar May 30 '25 16:05 achhina

I also have this issue with jupyterlab==4.2.5. For me, it appears to be happening on all 6.1.x versions. Dropping to 6.0.1 resolved the issue.

The contents of my jupyter/labextensions/jupyterlab-plotly/install.json when I have 6.1.2 installed (note the incorrect version also).

{
    "schemaVersion": 1,
    "name": "jupyterlab-plotly",
    "version": "6.0.1",
    "jupyterlab": {
      "mimeExtension": "lib/mimeExtension.js"
    }
}

Oddly enough this file is missing when 6.0.1 is installed.

hguturu avatar Jun 03 '25 21:06 hguturu

I bumped into this exact problem with jupyterlab 4.4.3. I'm going to try the downgrading solution

ssullivan avatar Jun 26 '25 15:06 ssullivan