Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Right extension for Plotly in JupyterLab?

Plotly is not working in Jupyterlab. I assume that there is a conflict in required extensions but I'm not sure. On checking troubleshooting on Plotly https://plotly.com/python/troubleshooting/ , they advise to remove extensions and install them again. But I found that there is additional extension that came with Jupyterlab update called 'jupyterlab-plotly-extension' which is not mentioned by Plotly in their instructions to make it working in JupyterLab https://plotly.com/python/getting-started/#jupyterlab-support-python-35

My question is: which extensions should be installed to make Plotly working in JupyterLab?

  • jupyterlab-plotly as mentioned in Plotly support
  • jupyterlab-plotly-extension that came with JupyterLab
like image 235
Maged Avatar asked Jun 27 '20 01:06

Maged


Video Answer


2 Answers

You can install plotly using pip or conda:

pip install "plotly>=5" "ipywidgets>=7.6"
# or if using conda
# conda install -c plotly "plotly>=5"
# conda install "ipywidgets>=7.6"

Plotly comes with support for both the Jupyter Notebook and JupyterLab. There is no need to install anything else for JupyterLab 3.0 and newer. The widget package and the renderer package are both included in plotly starting from v5.

For older versions of JupyterLab (1.x and 2.x) you will need a recent Node.js installed and install additional packages; do not run these commands if using newer version of JupyterLab:

pip install "ipywidgets>=7.5"
# renderer support
jupyter labextension install jupyterlab-plotly
# OPTIONAL: Jupyter widgets extension
jupyter labextension install @jupyter-widgets/jupyterlab-manager plotlywidget
like image 114
shashi walker Avatar answered Oct 09 '22 10:10

shashi walker


Enter 'jupyter labextension list' in a terminal or command to run the environment status. The example below shows my environment information with 'jupyter lab' running successfully.

xxxxx-no-iMac:~ xxxxx$ jupyter labextension list
JupyterLab v2.1.5
Known labextensions:
   app dir: /Library/Frameworks/Python.framework/Versions/3.6/share/jupyter/lab
        @jupyter-widgets/jupyterlab-manager v2.0.0  enabled  OK
        @jupyterlab/git v0.20.0  enabled  OK
        @lckr/jupyterlab_variableinspector v0.5.0  enabled  OK
        jupyterlab-plotly v1.5.4  enabled  OK
        nbdime-jupyterlab v2.0.0  enabled  OK
        plotlywidget v1.5.4  enabled  OK
like image 2
r-beginners Avatar answered Oct 09 '22 10:10

r-beginners