RuntimeError: maximum recursion depth exceeded

I began hitting this error after deleting a graph online and trying to replot locally. Both py.iplot and py.plot return same error.
Traceback as follows

File โ€œ/home/ktavabi/Projects/plotly.py/plotly/plotly/plotly.pyโ€, line 241, in plot
res = _send_to_plotly(figure, **plot_options)
File โ€œ/home/ktavabi/Projects/plotly.py/plotly/plotly/plotly.pyโ€, line 1401, in _send_to_plotly
cls=utils.PlotlyJSONEncoder)
File โ€œ/home/ktavabi/anaconda2/lib/python2.7/json/init.pyโ€, line 251, in dumps
sort_keys=sort_keys, **kw).encode(obj)
File โ€œ/home/ktavabi/Projects/plotly.py/plotly/utils.pyโ€, line 145, in encode
encoded_o = super(PlotlyJSONEncoder, self).encode(o)
File โ€œ/home/ktavabi/anaconda2/lib/python2.7/json/encoder.pyโ€, line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File โ€œ/home/ktavabi/anaconda2/lib/python2.7/json/encoder.pyโ€, line 270, in iterencode
return _iterencode(o, 0)
File โ€œ/home/ktavabi/Projects/plotly.py/plotly/utils.pyโ€, line 208, in default
return encoding_method(obj)
File โ€œ/home/ktavabi/Projects/plotly.py/plotly/utils.pyโ€, line 217, in encode_as_plotly
return obj.to_plotly_json()

Hey @kambysese โ€“

It looks like some error associated with JSON-ifying the figure. Could you paste the entire code snippet or a smaller code block that reproduces the issue?

I had this exact error, and was confused for hours because I had reused code that worked in a very similar situation. My data was an array of numpy.float128 objects. The issue was fixed by casting it to python float before adding it to my plot.

I havenโ€™t seen anywhere in the Plotly documentation that says certain numpy datatypes arenโ€™t supported for position data, but regardless, Plotly should support numpy datatypes like float128 for convenience. However, for anyone whose code throws a similar error, make sure that the data youโ€™re trying to plot is of a type provided by the Python standard library.