Skip to content

cannot write plotly figure to file with pickle #579

Closed
@latorrefabian

Description

@latorrefabian

import plotly.graph_objs as go
import pickle

file = open('myfile.pkl', 'wb')
a = go.Scatter(x=[1,2,3], y=[4,5,6])
figure = go.Figure(data = [a])
pickle.dump(figure, file)

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 1376, in dump
Pickler(file, protocol).dump(obj)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 224, in dump
self.save(obj)
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/pickle.py", line 306, in save
rv = reduce(self.proto)
File "xxx/bin/../lib/python2.7/copy_reg.py", line 84, in _reduce_ex
dict = getstate()
TypeError: 'NoneType' object is not callable

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions