Plotly plots not working in Jupyterlab
See original GitHub issueWhen I run this example:
import plotly.graph_objects as go
fig = go.Figure(data=go.Bar(y=[2, 3, 1]))
fig.show()
in a Jupyter notebook under jupyter lab I get no output. The output cell expands as if it is going to show output, but it is just blank. I see this error in the browser console:
VM458:2 Uncaught ReferenceError: require is not defined
at <anonymous>:2:17
at t.attachWidget (vendors~main.479571ea0f6c7741ac01.js:2)
at t.insertWidget (vendors~main.479571ea0f6c7741ac01.js:2)
at C._insertOutput (vendors~main.479571ea0f6c7741ac01.js:2)
at C.onModelChanged (vendors~main.479571ea0f6c7741ac01.js:2)
at m (vendors~main.479571ea0f6c7741ac01.js:2)
at Object.c [as emit] (vendors~main.479571ea0f6c7741ac01.js:2)
at e.emit (vendors~main.479571ea0f6c7741ac01.js:2)
at f._onListChanged (vendors~main.479571ea0f6c7741ac01.js:2)
at m (vendors~main.479571ea0f6c7741ac01.js:2)
Googling I see others that had that problem had bad installs of extensions, I don’t think I have that:
My jupyterlab + extension versions are:
xbk@30c1f8a93eeb:~/xbk_trade_advisory/code/chquery$ jupyter --version
jupyter core : 4.6.2
jupyter-notebook : 6.0.3
qtconsole : 4.7.1
ipython : 7.12.0
ipykernel : 5.1.4
jupyter client : 5.3.4
jupyter lab : 2.0.1
nbconvert : 5.6.1
ipywidgets : 7.5.1
nbformat : 5.0.4
traitlets : 4.3.3
xbk@30c1f8a93eeb:~/xbk_trade_advisory/code/chquery$ jupyter labextension list
JupyterLab v2.0.1
Known labextensions:
app dir: /usr/local/share/jupyter/lab
@jupyter-widgets/jupyterlab-manager v2.0.0 enabled OK
jupyterlab-plotly v4.9.0 enabled OK
plotlywidget v4.9.0 enabled OK
Thanks for any help with this.
Matt
Issue Analytics
- State:
- Created 3 years ago
- Reactions:17
- Comments:26 (4 by maintainers)
Top Results From Across the Web
Plots not showing up in Jupyter Lab (Plotly 3.0) - Plotly Python
When I use init_notebook_mode, it shows a blank space for plots but the plot is still not shown. from plotly.offline import plot, ...
Read more >Unable to display plotly figures output - JupyterLab
I am working on Jupyterlab on a docker container, on an EC2 machine on AWS, versions: IPython : 7.30.1 ipykernel : 6.6.0 ipywidgets...
Read more >Plotly Issue: (Graphs not showing even after publishing)
Plotly Issue: (Graphs not showing even after publishing) ... I guess a lot of you guys have had this problem nevertheless, I wanted...
Read more >Getting Plotly working in Jupyter Lab and fastpages
Plotly allows one to create interactive charts and maps with APIs in Python, R, and JavaScript. It's intuitive, highly customisable and from ...
Read more >Setting up Plotly Dash in JupyterLab & Jupyter Notebook
In this tutorial you'll learn to set up Jupyter Lab and Jupyter Notebook to run your Plotly Dash Apps, using PC or Mac....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I managed to make it work in jupyter lab using:
I figured out that setting
pio.renderers.default
toiframe
,iframe_connected
, orbrowser
works. But notjupyterlab
ornotebook
. When set tonotebook
an empty space shows up where the plot is supposed to be, when set tojupyterlab
, it finishes the computation and nothing happens.