Python Plotly: AttributeError: 'PlotlyJSONEncoder' Object Has No Attribute 'encoding'
Solution 1:
Full disclosure, I work for Plotly.
TL;DR
Looks like a recent change isn't fully compatible with your Python version.
pip install -I 'plotly==1.6.10'
That's just before the change that seems to be affecting you.
Explanation
The Plotly python module recently just updated our custom JSONEncoder
subclass to convert float('NaN')
, float('Inf')
, and float('-Inf')
to null
instead to to the extended JSON values nan
, Infinity
, and -Infinity
.
https://docs.python.org/2/library/json.html#infinite-and-nan-number-values
To do this we overrode iterencode
from the default JSONEncoder
. Something may have changed between the version of this we develop on and your version.
Permanent Fix
We'll try and recreate the error and come up with a fix shortly, thanks for posting about it!
(edit, there should have been two =
signs in the pip
command)
Post a Comment for "Python Plotly: AttributeError: 'PlotlyJSONEncoder' Object Has No Attribute 'encoding'"