Short answer: Bokeh does not support pickle. There are lots of reasons for this, among them a few:
-
Bokeh is actually two libraries, a Python and a JS one, and they have to communicate via a JSON protocol Given all the effort that necessarily went into a JSON serialization scheme, it did not make sense to put effort in to supporting pickle (which is no use for BokehJS) as well
-
Bokeh has been under highly active development for quite some time. Even if the user-facing API remains compatible, it would have been difficult/impossible to implement pickle support in a way that did not often break across releases
So as @_jm mentions, the export options are probably what you are looking for. But to be clear, those are for reconstituting pots directly as browser content, they won’t get you Python objects back. If you truly are looking to round-trip Python objects, there are potentially ways to do that, and we could discuss them, but be aware they would have version sensitivities (e.g. at present you might get forward-compat, but back-compat would break if the stored output has any newer Bokeh properties than the old version of Bokeh you try to re-hydrate things with). It would help if you could describe exactly what you are trying to accomplish at a conceptual/UX level in more detail.