nteract / examples

Example nteract notebooks with links to execution on mybinder.org
BSD 3-Clause "New" or "Revised" License
27 stars 21 forks source link

Usage of Deprecated module plotly.plotly in the Plotly example notebook #34

Open jmaniac opened 2 years ago

jmaniac commented 2 years ago

nteract Version : 0.28.0 Notebook: python\plotly.ipynb

In the cell demonstrating the advanced scatter plot features using the Life expectancy vs Per Capita GDP, the notebook is using the old deprecated module plotly.plotly and throws an error.

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
C:\Users\USERNAME\AppData\Local\Temp/ipykernel_21460/3045308087.py in <module>
----> 1 import plotly.plotly as py
      2 import plotly.graph_objs as go
      3 
      4 import pandas as pd
      5 import math

C:\Python39\lib\site-packages\plotly\plotly\__init__.py in <module>
      2 from _plotly_future_ import _chart_studio_error
      3 
----> 4 _chart_studio_error("plotly")

C:\Python39\lib\site-packages\_plotly_future_\__init__.py in _chart_studio_error(submodule)
     41 
     42 def _chart_studio_error(submodule):
---> 43     raise ImportError(
     44         """
     45 The plotly.{submodule} module is deprecated,

ImportError: 
The plotly.plotly module is deprecated,
please install the chart-studio package and use the
chart_studio.plotly module instead.

If installed chart-studio and changed to the first line to import chart_studio.plotly as py it works fine.

It would be better to change the module to the newer and working chart-studio.