Skip to content

extension "jupyterlab-plotly" does not yet support the current version of JupyterLab (v4) #4354

Description

@bsdz

I'm trying to install the lab extension for JupyterLab v4.0.5 with the command:

$ jupyter labextension install  jupyterlab-plotly
(Deprecated) Installing extensions with the jupyter labextension install command is now deprecated 
and will be removed in a future major version of JupyterLab.

Users should manage prebuilt extensions with package managers like pip and conda, and extension 
authors are encouraged to distribute their extensions as prebuilt packages
/pyenvs/jupyterlab-4.x/.venv/lib/python3.10/site-packages/jupyterlab/debuglog.py:56: 
   UserWarning: An error occurred. warnings.warn("An error occurred.")
/pyenvs/jupyterlab-4.x/.venv/lib/python3.10/site-packages/jupyterlab/debuglog.py:57: 
   UserWarning: ValueError: The extension "jupyterlab-plotly" does not yet support the current version of JupyterLab.


Conflicting Dependencies:
JupyterLab        Extension      Package
>=2.0.0 <3.0.0    >=1.2.3 <2.0.0 @lumino/messaging
>=2.0.1 <3.0.0    >=1.8.1 <2.0.0 @lumino/widgets
  warnings.warn(msg[-1].strip())
/pyenvs/jupyterlab-4.x/.venv/lib/python3.10/site-packages/jupyterlab/debuglog.py:58: UserWarning: See 
the log file for details: /tmp/jupyterlab-debug-l5ilibax.log
  warnings.warn(f"See the log file for details: {log_path!s}")

The conflicting dependencies match what I see in the master branch for packages/javascript/jupyterlab-plotly/package.json.

I keep my jupyter virtual environment separate to my working kernels. I'm not sure if there's a different way to install plotly for JupyterLab v4.

Activity

  1. ned2 commented on Oct 12, 2023

    @ned2
    Contributor

    @bsdz you no longer need to install a Jupyter extension to use Plotly in JupyterLab. The current Plotly documentation indicates you just need to install the Python packages jupyterlab and ipywidgets. (Note there are minimum version indicated in the docs)

  2. bsdz commented on Oct 12, 2023

    @bsdz
    Author

    @bsdz you no longer need to install a Jupyter extension to use Plotly in JupyterLab. The current Plotly documentation indicates you just need to install the Python packages jupyterlab and ipywidgets. (Note there are minimum version indicated in the docs)

    I beg to differ. This works in my JupyterLab 3.6.5 set up only if I install the the jupyterlab-plotly extension. The documentation is, unfortunately, wrong here. If I remove the extension from my JupyterLab v3 set up then the plots disappear. They reappear again when I reinstall the extension.

    As I said I earlier, I keep my Jupyter virtual environments separate to my active kernels and this is perhaps why i need to install the lab extension.

  3. ned2 commented on Oct 12, 2023

    @ned2
    Contributor

    ah, I'm just going by what the docs say on exactly which version this changes to be simpler. But regardless of whether this works with v3 or not, in your original description of the issue you mentioned you tried with JupyterLab v4, where this should apply.

    ahh right, I don't know if using a distinct Jupyter venv from your kernel venvs would impact this. @alexcjohnson do you know how well that setup is supported?

  4. m-erhardt commented on Oct 16, 2023

    @m-erhardt

    I guess I am facing the same issue.

    I run jupyterlab==4.0.7 and ipywidgets==8.1.1 (same issue with jupyterlab==4.0.6) behind jupyterhub==4.0.2 with dockerspawner==12.1.0.
    Within my docker-spawned JupyterLab container I also have separate venvs for JupyterLab and my kernels.

    Plotly plots dont show up. When examinig the raw .ipynb-file I can see that the cell output is populated with html/css.

    (jupyter) jupyter labextension list
    JupyterLab v4.0.7
    /opt/pyenvs/jupyter/share/jupyter/labextensions
            jupyterlab_pygments v0.2.2 enabled  X (python, jupyterlab_pygments)
            jupyterlab-gitlab v4.0.0 enabled OK (python, jupyterlab-gitlab)
            @jupyter-widgets/jupyterlab-manager v5.0.9 enabled OK (python, jupyterlab_widgets)
    
    
       The following extensions are outdated:
            jupyterlab_pygments
            
       Consider checking if an update is available for these packages.
    

    A (non-ideal) workaround is to use the iframe renderer. This results in the Ploty plots showing as usual.

    import plotly.io as pio
    pio.renderers.default = 'iframe'
    

    Hints are welcome and if you need further information to narrow down the root cause feel free to ask...

  5. sarahscheffler commented on Dec 7, 2023

    @sarahscheffler

    I am having the same issue in TLJH (jupyterlab 4.0.7) running on a small Ubuntu 22.04 server. plotly 5.18.0 and ipywidgets 8.1.1 installed with pip -- my understanding from the docs is that this is all I should need.

    When creating any plotly fig and running fig.show(), a blank space appears but without any actual plot.

    Many thanks to @m-erhardt, because the iframe workaround works to make plotly plots appear for now.

    plotly 5.18.0    # installed with pip
    
    IPython          : 8.16.1
    ipykernel        : 6.25.2
    ipywidgets       : 8.1.1
    jupyter_client   : 8.4.0
    jupyter_core     : 5.4.0
    jupyter_server   : 2.8.0
    jupyterlab       : 4.0.7
    nbclient         : 0.8.0
    nbconvert        : 7.9.2
    nbformat         : 5.9.2
    notebook         : 7.0.6
    qtconsole        : not installed
    traitlets        : 5.11.2
    
  6. m-erhardt commented on Dec 12, 2023

    @m-erhardt

    I was able to fix this issue by adding plotly to the JupyterLab venv.
    Apparently this is required when using multiple kernels/venvs and running JupyterLab in a venv of it's own.
    It would probably make sense to add this to the Plotly documentation.

    JupyterLab venv

    jupyterlab==4.0.9
    ipywidgets==8.1.1
    plotly==5.18.0
    

    Kernel venv 1

    [...]
    plotly==4.14.3
    [...]
    

    Kernel venv 2

    [...]
    plotly==5.11.0
    [...]
    
  7. Coding-with-Adam commented on Dec 12, 2023

    @Coding-with-Adam
    Contributor

    Thanks for the comment @m-erhardt .
    Just to confirm your solution. You got Plotly to work in JupyterLab4 just by adding plotly to the JupyterLab venv?
    You didn't have to do anything else?

  8. m-erhardt commented on Dec 12, 2023

    @m-erhardt

    @Coding-with-Adam exactly.

    I made no other changes besides of bumping jupyterlab from 4.0.5 all the way up to 4.0.9 in the course of this issue.
    jupyterlab==4.0.9 without plotly did not work as well.

    The requirements.txt for my JupyterLab venv contains exactly these three packages.

  9. bsdz commented on Dec 12, 2023

    @bsdz
    Author

    @m-erhardt, out of curiosity, are your JupyterLab and kernel venvs on the same host? are they using the same user id? if so, do you ensure their separation by setting different JUPYTER_RUNTIME_DIR, JUPYTER_DATA_DIR and JUPYTER_CONFIG_DIR environment variables for each?

  10. m-erhardt commented on Dec 13, 2023

    @m-erhardt

    @bsdz

    As mentioned in my first comment in this issue I use JupyterLab behind JupyterHub and spawn an individual JupyterLab container for each user. So there is complete separation between user-environments.

    My venvs are not exatly "on the same host" but within the same container/image (which is somewhat comparable).

    So for every user there is one container with one instance of JupyterLab which is always running with the same configuration and environment variables.

    In order to run individual notebooks with other Python versions and venvs I registered my other virtual environments as ipykernels.

    /opt/pyenvs/${kernel_venv_1}/bin/python -m ipykernel install --prefix=/opt/pyenvs/${jupyterlab_env} --name 'venv1' --display-name 'Venv 1'
    /opt/pyenvs/${kernel_venv_2}/bin/python -m ipykernel install --prefix=/opt/pyenvs/${jupyterlab_env} --name 'venv2' --display-name 'Venv 2'
    [...]

    This will create kernelspec files at /opt/pyenvs/${jupyterlab_env}/share/jupyter/kernels/${kernel_venv}/kernel.json.

    You can then select which kernel to use for each notebook from the JupterLab UI.

    The reasoning behind this is that I always want to use the latest version of Python and JupyterLab for security reasons and to profit from recent bug fixes.

    But my particular use-case dictates that I need to provide multiple Python versions with pinned package versions for executing notebooks to guarantee reproducible research results.

  11. bsdz commented on Dec 13, 2023

    @bsdz
    Author

    @m-erhardt , that's interesting thanks. I'm not using JupyterHub, but I do serve my kernels inside & outside of docker containers using Enterprise Gateway. I'm sure I tested installing plotly in both the JupyterLab venv as well as my kernel venvs already but I will give it another go. Tbh I've parked my migration to JLab4 because of several other issues where 3rd party extensions are yet to be updated.

  12. lahwaacz commented on Feb 2, 2024

    @lahwaacz

    Can you comment on the issue discussed in https://community.plotly.com/t/does-plotly-work-with-jupyterlab-4/76095 ? Specifically, I get these JavaScript errors with plotly 5.18 and jupyterlab 4.0.12 and ipywidgets 8.1.1 and :

    Failed to load model class 'FigureModel' from module 'jupyterlab-plotly'
    P.f.j@http://localhost:8888/lab/extensions/jupyterlab-plotly/static/remoteEntry.70a4f7e7a0383740860d.js:1:7014
    P.e/<@http://localhost:8888/lab/extensions/jupyterlab-plotly/static/remoteEntry.70a4f7e7a0383740860d.js:1:1548
    P.e@http://localhost:8888/lab/extensions/jupyterlab-plotly/static/remoteEntry.70a4f7e7a0383740860d.js:1:1526
    exports@http://localhost:8888/lab/extensions/jupyterlab-plotly/static/133.7957020c5e8bc5703dbc.js?v=7957020c5e8bc5703dbc:1:339
    loadClass@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.a63a8d293fb35a52dc25.js?v=a63a8d293fb35a52dc25:1:75207
    loadModelClass@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.ebc7a55ea1768712771f.js?v=ebc7a55ea1768712771f:1:10729
    _make_model@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.ebc7a55ea1768712771f.js?v=ebc7a55ea1768712771f:1:7517
    new_model@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.ebc7a55ea1768712771f.js?v=ebc7a55ea1768712771f:1:5137
    handle_comm_open@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.ebc7a55ea1768712771f.js?v=ebc7a55ea1768712771f:1:3894
    134/v/this._handleCommOpen@http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/134.a63a8d293fb35a52dc25.js?v=a63a8d293fb35a52dc25:1:73473
    _handleCommOpen@http://localhost:8888/static/lab/jlab_core.826ed748f0a8a70a419e.js?v=826ed748f0a8a70a419e:1:1243183
    
  13. m-erhardt commented on Feb 5, 2024

    @m-erhardt

    @lahwaacz I can't give an definitive answer but based on the class-loading error message Failed to load model class 'FigureModel' from module 'jupyterlab-plotly' I would guess you are missing the jupyterlab-plotly extension.

    You can check if the extension is present by running jupyter labextension list in your shell.

    As the jupyterlab-plotly extension is not available as Python-package from PyPi yet I had to install it the old-fashioned way by running jupyter labextension install jupyterlab-plotly.

    These extensions are present within my JupyterLab 4.0.12 container:

    (jupyter) jupyter labextension list
    JupyterLab v4.0.12
    /opt/pyenvs/jupyter/share/jupyter/labextensions
            jupyterlab-plotly v5.18.0 enabled  X
            jupyterlab_pygments v0.3.0 enabled OK (python, jupyterlab_pygments)
            jupyterlab-gitlab v4.0.0 enabled OK (python, jupyterlab-gitlab)
            @jupyter-notebook/lab-extension v7.0.7 enabled OK
            @jupyter-widgets/jupyterlab-manager v5.0.9 enabled OK (python, jupyterlab_widgets)
    
    
       The following extensions are outdated:
            jupyterlab-plotly
            
       Consider checking if an update is available for these packages.
    
  14. lahwaacz commented on Feb 5, 2024

    @lahwaacz

    @m-erhardt The JupyterLab Support section in the README says that jupyter labextension install must be installed for JupyterLab 2 or earlier. Granted, it also says "The instructions above apply to JupyterLab 3.x" without mentioning version 4, but that also indicates incomplete support for JupyterLab 4.

  15. gvwilson commented on Jul 11, 2024

    @gvwilson
    Contributor

    Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

  16. 8 remaining items

  17. marthacryan commented on Dec 6, 2024

    @marthacryan
    Contributor

    Hi! I recently made a PR (#4822) to update our jupyter support and found that this extension is no longer necessary for newer versions of jupyterlab (>=3) and notebook (>=7). If you look at the top of the output of your jupyter labextension install command, you can see: "(Deprecated) Installing extensions with the jupyter labextension install command is now deprecated and will be removed in a future major version of JupyterLab." In fact, you don't need any extension installed to use plotly in these newer versions - just pip install plotly. Are you having issues using plotly in jupyter lab/notebook?

  18. lahwaacz commented on Dec 6, 2024

    @lahwaacz

    Are you having issues using plotly in jupyter lab/notebook?

    @marthacryan Yes, see #4354 (comment)

  19. marthacryan commented on Dec 6, 2024

    @marthacryan
    Contributor

    @lahwaacz Oh okay - do you mind sending the code to reproduce that error? It looks like you might be using the FigureWidget? I'd be curious to see whether just using Figure works for you (of course we'll still want to make sure FigureWidget works, it would just be a good datapoint to have). In that case, I think you may actually be able to fix this in the newest release of plotly due to the changes in #4823 - do you mind trying out pip install --upgrade --pre plotly and seeing if it helps? You'll also need to pip install anywidget if you don't already have that.

  20. lahwaacz commented on Dec 8, 2024

    @lahwaacz

    @marthacryan Based on the plotly documentation, it seems that the interaction between plotly and jupyterlab is based on FigureWidget. Displaying the plain static Figure objects in Jupyter notebooks is not the same thing as you don't need any JupyterLab extension for that. I think one of those examples was what I was trying to run the last time...

    I don't understand Plotly's approach to the "support" of various components. There is a difference between "it is supported" and "it just works", since the former is a conscious effort to make it work and the latter might be just "by accident". In the last stable release, 5.24.1, plotly still specifies jupyterlab ~=3.0 in the optional-requirements.txt as well as the disputed JupyterLab Support section in the README. I see that both things changed in the master branch (requires-optional.txt, README). However, the dependency on jupyter is unversioned: ok, so you want to have support for jupyter, but don't say which version is "supported", which is not useful. Can anybody from the Plotly team clearly state if JupyterLab v4 is fully supported? It would be a good idea to reflect this in the requirements file.

  21. WannesDeVosWork commented on Dec 9, 2024

    @WannesDeVosWork

    @marthacryan, I tried the --pre version of plotly and this fixes the issue for me.

  22. gvwilson commented on Dec 9, 2024

    @gvwilson
    Contributor

    @lahwaacz thanks for your feedback - we've been reluctant to pin specific versions of Jupyter and related packages for fear of disrupting things like CI pipelines. We have a clear idea internally of what versions we support in our upcoming release, and you're right, we need to translate that into a support matrix and get it posted soon. However, our priority right now is to wrap up the plotly.py 6.0 release, and the Dash 3.0 release right after it, which means it will be early January before we can produce that. If you would like to mail me (greg.wilson@plot.ly) I'd be happy to follow up with you then - I'd like to make sure you're included in discussions. thanks - Greg

  23. lahwaacz commented on Feb 3, 2025

    @lahwaacz

    I've noticed that Plotly 6.0 still requires jupyterlab~=3.0 which excludes 4.0 and newer:

    https://github.com/plotly/plotly.py/blob/v6.0.0/packages/python/plotly/pyproject.toml#L2

    What is the rationale? As far as I can tell there is no labextension in plotly anymore since you use anywidget, so I don't see any blocker v3.0.

  24. marthacryan commented on Feb 3, 2025

    @marthacryan
    Contributor

    Ah yes I actually was just changing that in this PR: #4970 because I noticed that the pyproject.toml was requiring that. It shouldn't!

  25. relativityspace-jsmith commented on Apr 9, 2025

    @relativityspace-jsmith

    Looks like this is fixed as of plotly 6.0.1? I'm able to use plotly 6.0.1 and jupyterlab 4 together without any special workarounds, as far as I can tell.

  26. klonuo commented on Aug 26, 2025

    @klonuo

    Doesn't work for me (plotly 6.3.0, jupyterlab 4.4.6):

    Image
  27. relativityspace-jsmith commented on Aug 26, 2025

    @relativityspace-jsmith

    I have code like

    from plotly.offline import iplot
    import plotly
    
    some_fig = plotly.graph_objs.Figure(layout_title_text="my title")
    some_fig.update_layout(
        xaxis_title="my x label",
        yaxis_title="my y label"
    )
    some_fig.add_trace(plotly.graph_objs.Scatter(
        x=my_x_data,
        y=my_y_data))
    iplot(some_fig)

    Does that get anything for you?

  28. klonuo commented on Aug 27, 2025

    @klonuo

    Thanks, but unfortunately it the same:

    Image

    I tried also suggestion from the plotly forum, to use iframe renderer: https://community.plotly.com/t/plotly-not-rendering-in-jupyterlab-just-leaving-an-empty-space/85588/6

    And while it does show the figure it's very slow...

  29. klonuo commented on Aug 27, 2025

    @klonuo

    My issue turned out to be missing jupyterlab-plotly extension.

    I tried to install with jupyter labextension install jupyterlab-plotly, but it raises conflict with lumino widgets.

    As I read the extension is automatically installed when installing plotly, I uninstalled plotly then reinstalled, and everything is as expected now, even without iplot.

    And BTW, iframe renderer method is not slow, but I had a large data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2considered for next cyclefeaturesomething new

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions