How to fix PlotlyRequestError?

Viewed 11338

I get an 'PlotlyRequestError: No message' when I execute the code.

import plotly
import plotly.plotly as py
import plotly.graph_objs as go

Filedata = pd.read_csv('C:\\Documents\\Book4.csv')
data = [go.Scatter(x=Filedata.ix[:,0],y=Filedata.ix[:,1])]
layout = go.Layout(
title='Analysis 2016',
xaxis=dict(title='Startdate'),
yaxis=dict(title='Conductivity'))

fig = go.Figure(data=data, layout=layout)
py.iplot(fig)
3 Answers

I had the same issue and I solved the problem by importing plotly like this:

import plotly.plotly as py
import plotly.graph_objs as go
# these two lines allow your code to show up in a notebook
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode()

And then calling iplot like this:

plotly.offline.iplot(...)

I had the same issue and I solved the problem by importing plotly and cufflinks like this:

from plotly.offline import iplot
import cufflinks as cf

and then apply

cf.go_offline()
Related