Black Lives Matter. Please consider donating to Black Girls Code today.

Baby steps to get Plotly running in Jupyter Lab

Trying to get Plotly running in a fresh install of Jupyter Lab. Being pretty unfamiliar with the entire Jupyter/Conda/Python ecosystem I’m getting lost in all the different install instructions.

Is there a chance someone could help me walk through my install to make sure I have everything installed correctly before I move on to figuring out what might be wrong with my syntax.

The steps I followed (from the site)
(from within Anaconda 3 prompt)

conda install jupyterlab=1.0 "ipywidgets>=7.5"
set NODE_OPTIONS=--max-old-space-size=4096
jupyter labextension install @jupyter-widgets/jupyterlab-manager@1.0 --no-build
jupyter labextension install jupyterlab-plotly@1.1.0 --no-build
jupyter labextension install plotlywidget@1.1.0 --no-build
jupyter labextension install jupyterlab-chart-editor@1.2 --no-build
jupyter lab build
set NODE_OPTIONS=
jupyter lab
  • New Notebook - Python 3
import plotly.graph_objects as go
fig = go.Figure(data=go.Bar(y=[2, 3, 1]))
fig.show()

Result is big blank block

Here is my output from labextensions list

JupyterLab v1.0.10
Known labextensions:
app dir: C:\ProgramData\Anaconda3\share\jupyter\lab
@jupyter-widgets/jupyterlab-manager v1.0.2 enabled ok
@jupyterlab/dataregistry-extension v2.2.2 enabled ok
jupyterlab-chart-editor v1.2.0 enabled ok
jupyterlab-plotly v1.1.0 enabled ok
jupyterlab_voyager v1.0.2 enabled ok
plotlywidget v1.1.0 enabled ok

Chrome Version 77.0.3865.75 (Official Build) (64-bit)
Windows 10

My frustration comes from going through these steps and then copying and pasting the simple examples from https://plot.ly/python/getting-started/#jupyterlab-support-python-35 and still not getting anything rendered. A big blank output block appears but nothing renders. I’ve tried to go through the post where people had similar issue with plots not rendering but none of the items discussed seemed to help.

Much appreciation in advance

-Andy

I spent 2 hours trying to figure it out this problem with the most recent jupyterlab/plotly quick start guide (https://plot.ly/python/getting-started/). What actually worked for me: use fig=FigureWidget() instead of Figure(). And also in order to display the image call fig only, not fig.show()

1 Like

This needs an update.

The latest installation instructions are always at https://plot.ly/python/getting-started/ (updated whenever there is an update) and we also have a troubleshooting guide here https://plot.ly/python/troubleshooting/ if you run into problems :slight_smile: