Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

TypeError: Plotly.downloadImage is not a function

Input

import plotly
import plotly.plotly as py
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
import plotly.graph_objs as go
from plotly.graph_objs import Figure, Layout, Bar, Scatter

init_notebook_mode(connected=True)

data = [{'x': [1, 2, 3], 'y': [5, 2, 7]}]
iplot(data, image='png')

Expected Behavior

  1. plot directly in jupyter notebook
  2. Download plot as .png

Actual Behavior

  1. plot directly in jupyter notebook
  2. Throw error:
Javascript error adding output!
TypeError: Plotly.downloadImage is not a function
See your browser Javascript console for more details.

@vish I’ve just run your code with Plotly 2.0.15 (the last version) and it plots the figure in notebook and save the image. No error message is displayed.

1 Like

@empet I just tried running the code in a new jupyter notebook and, like you, did not replicate the error.

That said, this error continues in the original notebook in which this code was contained and occurs even when (a) this code is the first code to execute and (b) I make a copy of the notebook.

Closed.

Explanation: Issue is not replicated when code is executed in new kernels. Cause of original issue remains unknown.