AttributeError: module ' plotly.validators.layout.template.data 'has no attribute 'IsosurfacesValidator'

I have an interactive graph in python. The code below works in Azure Notebook, but I had to migrate my code to JupyterLab and it is presenting the following error:

AttributeError: module ' plotly.validators.layout.template.data ' has no attribute 'IsosurfacesValidator'

Follows the code.

import pandas as pd
import plotly.plotly as py
import plotly.offline as py
import plotly.graph_objs as go
py.init_notebook_mode(connected=True)

trace = go.Bar(x = problema.index,
               y = problema)
data = [trace]

layout = go.Layout(title='Ranking de Problema',
                   yaxis={'title':'Quantidade'},
                   xaxis={'title': 'Problema'})


fig = go.Figure(data=data, layout=layout)
py.iplot(fig)
Author: Diego Souza, 2019-02-05

1 answers

I found that I was presenting this error for a simple reason. I had to have Node.Js installed on my machine to be able to run this code in Anaconda / JupyterLab.

1st step: I downloaded Node.Js through the site: https://nodejs.org/en / and installed the same.

2nd step: I opened the JupyterLab CMD and installed the Plotly extension, through the following code:

jupyter labextension install @jupyterlab/plotly-extension

3rd step: Run the code that was presenting the error below again

Module ' plotly.validators.layout.template.data ' has no attribute 'IsosurfacesValidator'

 2
Author: Beatriz Benz, 2019-02-05 18:34:16