6

I am running JupyterLab 3.0.6 and Plotly 4.14.1. It seems all the plotly dash plugins are outdated? Is there any extension that works with JupyterLab 3 yet?

E.g.

import plotly.express as px
px.line([1,2,3,2])

Only shows an empty output.

Soerendip
  • 7,684
  • 15
  • 61
  • 128
  • 1
    FYI: In June 2022, with Python 3.9, jupyterlab 3.3.2, plotly 5.8.2, ipywidgets 7.7.0, I also got no errors and empty output. I thought restarting the kernel was enough for the pip installs and imports to take effect. But they didn't. Instead, I had to kill and restart jupyterlab itself for the Plotly graph to become visible. – devdanke Jun 19 '22 at 10:26

4 Answers4

2

It is working now.

conda install -c plotly plotly=4.14.3
conda install "notebook>=5.3" "ipywidgets>=7.5"
jupyter labextension install jupyterlab-plotly@4.14.3
# OPTIONAL: Jupyter widgets extension
jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget@4.14.3

https://plotly.com/python/getting-started/

Soerendip
  • 7,684
  • 15
  • 61
  • 128
  • 1
    If this is actually necessary for JupyterLab 3, that linked guide should be updated. [The JupyterLab section](https://plotly.com/python/getting-started/#JupyterLab-Support) currently says _"jupyterlab>=3 and ipywidgets>=7.6 contain everything you need to run JupyterLab."_ Then it gives `labextension` commands _"for JupyterLab 2 or earlier."_ – tdy Aug 26 '21 at 05:44
1

This question has already been answered by one of the plotly developers.

Plotly express is not rendered in jupyter lab

Edit: That link is old sorry. After some more research it appears jupyter lab 3 is not currently compatible with plotly. They are currently working on it.

https://community.plotly.com/t/jupyterlab-plotly-not-compatible-with-jupyterlab-3-0/48777

Devin Burke
  • 520
  • 2
  • 8
0

As mentioned in the comment How to show Plotly figures in JupyterLab 3+? with JupyterLab 3.x and Plotly 5.x labextension installation of plotly is outdated.

Installation: https://plotly.com/python/getting-started/#installation

J3ernhard
  • 252
  • 3
  • 12
-1

To install Plotly on JupyterLab 3 on ubuntu is necessary to install nodejs, npm and jupyterlab plotly extension

The instructions on the plotly website didn't worked for me. The graph was being rendered as a white square. I discovered that jupyterlab plotly extension is working, but on Ubuntu it depends on nodejs and npm.

apt install nodejs npm
jupyter labextension install jupyterlab-plotly 

Reestart the jupyter and it should be working like the example bellow.

enter image description here

nicolaskruchten
  • 26,384
  • 8
  • 83
  • 101
Lucas
  • 258
  • 2
  • 5