# RuntimeError: maximum recursion depth exceeded

**URL:** <https://community.plotly.com/t/runtimeerror-maximum-recursion-depth-exceeded/2174>\
**Category:** 📊 Plotly Python\
**Created:** [September 22, 2016, 8:23pm UTC](https://community.plotly.com/t/runtimeerror-maximum-recursion-depth-exceeded/2174 "2016-09-22T20:23:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kambysese](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/kambysese/32/553_2.png) [@kambysese](https://community.plotly.com/u/kambysese)\
**Post date:** [September 22, 2016, 8:23pm UTC](https://community.plotly.com/t/runtimeerror-maximum-recursion-depth-exceeded/2174/1 "2016-09-22T20:23:51Z")

</div>

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()

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [October 3, 2016, 4:21pm UTC](https://community.plotly.com/t/runtimeerror-maximum-recursion-depth-exceeded/2174/2 "2016-10-03T16:21:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![wdumm88](https://avatars.discourse-cdn.com/v4/letter/w/57b2e6/32.png) [@wdumm88](https://community.plotly.com/u/wdumm88)\
**Post date:** [April 1, 2018, 10:48pm UTC](https://community.plotly.com/t/runtimeerror-maximum-recursion-depth-exceeded/2174/3 "2018-04-01T22:48:24Z")

</div>

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.
