✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Key error when exporting static plots


I have faced the below error numerous times and at random occasions when trying to export images to jpeg or png formats. I am not able to understand what’s causing this - does anyone have an idea?

Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/plotly/plotly/plotly.py”, line 787, in save_as
img = cls.get(figure_or_data, format, width, height, scale)
File “/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/plotly/plotly/plotly.py”, line 710, in get
raise exceptions.PlotlyError(return_data[‘error’])
KeyError: ‘error’


Thank you for the reply!

From the thread it seems the issue was with the limit to the number of API calls per day. However, when I tried to re-run the code again after 24hrs, I got the same error (which should not have happened if the issue was indeed the limit to API calls). Mind you, I am exporting images using the py.image.save_as() method (https://plot.ly/python/static-image-export/), and not the py.image.get(). Would you know what possibly could be going wrong here?


Exporting images online will also count towards your API limit.

But it should’ve resetted the next day and not caused an error, right?