Plotly.py: plotly 3.0.0 installation requirements for use in JupyterLab

Created on 10 Jul 2018  路  16Comments  路  Source: plotly/plotly.py

The plotly 3.0.0 installation requirements indicate that one should install the plotlywidget extension to use the package in JupyterLab. It seems that plotlywidget and plotly-extension don't get along; perhaps this should be noted in the installation instructions?

Most helpful comment

@lebedov @dhirschfeld @gnestor
I just released version 3.1.0 of plotly.py and 0.2.0 of plotlywidget. I tested out this configuration with version 0.16 of @jupyterlab/plotly-extension and everything seems to be working together great! I'm guessing that there was some Plotly.js version conflict between plotlywidget and @jupyterlab/plotly-extension before.

I also added the installation instructions for @jupyterlab/plotly-extension to our README. Since there are so many freakin' versions to get right to get everything working in JupyterLab I decided to start putting explicit version numbers on all of the install steps in the README.

Here are the current versions of everything that are working well for me.

pip install plotly==3.1.0
pip install "notebook>=5.3" "ipywidgets>=7.2"
pip install jupyterlab==0.32.1
jupyter labextension install @jupyter-widgets/[email protected] # Jupyter widgets support
jupyter labextension install [email protected]  # FigureWidget support
jupyter labextension install @jupyterlab/[email protected]  # offline iplot support

From here on out, every time I release a new version of plotly.py or plotlywidget I'll update the versions of jupyterlab, @jupyter-widgets/jupyterlab-manager, and @jupyterlab/plotly-extension in the README to the most recent compatible versions.

All 16 comments

Thanks for the report @lebedov. We do need to try to figure out how to make these extensions get along.

Is the plotly-extension even needed anymore?
c.c. @gnestor

I have successfully installed both. It's certainly possible that plotlywidget renders plotly-extension obsolete, but I haven't played with plotlywidget enough to be sure.

The Error: Cannot find module 'plotlywidget/package.json' error message suggests that plotlywidget package was not properly downloaded (after doing jupyter labextension install plotlywidget).

@jonmmease @dhirschfeld Have you tried installing the plotlywidget labextension?

I haven't tried to install and test both plugins together yet, but I don't think there's any fundamental reason why it should be a problem.

My current understanding is that plotly-extension is not obsolete because it provides the mime-type support needed by plotly.offline.iplot, and the support for opening .plotly.json files as plots.

plotlywidget on the other hand provides only the JupyterWidget corresponding to the new FigureWidget class.

I'll post my notes here when I get a chance to try out installing both.

I have, and I thought they installed fine however I don't have an environment set up to test at the moment

@jonmmease is correct in that plotly-extension does enable users to open Plotly files (something that plotlywidget does not do) and it also supports rendering plotly charts using plotly.py < 3.

I'm wondering if there is any appetite to subsume the functionality of plotly-extension into plotlywidget itself? Or vice-versa. Just from a user perspective installing 1 extension to get all the functionality is easier than installing 2.

This would be @jonmmease's call 馃憤

FYI, there are other plotly-related jupyerlab extensions in the wild, such as https://github.com/plotly/jupyterlab-chart-editor.

I'm not ready to merge them at this point, but it is something to consider down the road. I wonder if there's a way to specify a meta-package that is a collection of JupyterLab extensions to all be installed together.

And I am excited to play with the jupyterlab plotly chart editor!

Maybe the new extension manager will assist in helping advertise the existence of extensions - I can imagine (in future) a recommendation feature such as in vscode.

@lebedov @dhirschfeld @gnestor
I just released version 3.1.0 of plotly.py and 0.2.0 of plotlywidget. I tested out this configuration with version 0.16 of @jupyterlab/plotly-extension and everything seems to be working together great! I'm guessing that there was some Plotly.js version conflict between plotlywidget and @jupyterlab/plotly-extension before.

I also added the installation instructions for @jupyterlab/plotly-extension to our README. Since there are so many freakin' versions to get right to get everything working in JupyterLab I decided to start putting explicit version numbers on all of the install steps in the README.

Here are the current versions of everything that are working well for me.

pip install plotly==3.1.0
pip install "notebook>=5.3" "ipywidgets>=7.2"
pip install jupyterlab==0.32.1
jupyter labextension install @jupyter-widgets/[email protected] # Jupyter widgets support
jupyter labextension install [email protected]  # FigureWidget support
jupyter labextension install @jupyterlab/[email protected]  # offline iplot support

From here on out, every time I release a new version of plotly.py or plotlywidget I'll update the versions of jupyterlab, @jupyter-widgets/jupyterlab-manager, and @jupyterlab/plotly-extension in the README to the most recent compatible versions.

Curious if this will work with the imminent jupyterlab 0.33? I'm waiting for the jupyterlab release before upgrading my environment but I'm conscious that not all extensions will immediately be compatible with the new version.

Yeah, I'm not sure. It might just work if you upgrade jupyterlab to 0.33 and @jupyter-widgets/jupyterlab-manager to 0.36.

Let us know if you give it a try!

Let us know if you give it a try!

Will do!

@jonmmease Confirming that the configuration you described works for me too. Thanks!

Awesome @lebedov, I think I'll go ahead and close this issue now. Thanks for bringing it up!

Was this page helpful?
0 / 5 - 0 ratings