Bokeh 2.0 potentially broken in Streamlit

There is a new Bokeh release that is coming up in the near future. It is a major number release. I tried the latest dev build and Streamlit did not render my bokeh plot, and gave no errors. This github issue documents what I am referring to in a little more detail (bottom of thread).

I just thought I would bring this to the attention of you all before its release. Thanks for the great tool!

2 Likes

Hello @mmcguffi,

Thanks for the heads up. Under the hood Streamlit emits the bokeh chart into a JSON with bokeh.embed.json_item and then uses this JSON in bokehjs.embed.embed_item on the frontend side.

My guess is, if Bokeh on the Python side is upgraded to 2.0.0, then BokehJS on the JS side should also be 2.0.0 but I could not find a corresponding version for BokehJS to test.

I tested Python Bokeh 2.0.0rc1 and the JSON item from 1.4.0 to 2.0.0rc1 do seem to change a small bit. It’s strange BokehJS did not spit an error on loading the JSON item…The only error log I could get was :

[bokeh] JS/Python version mismatch
[bokeh] Library versions: JS (1.3.4) / Python (2.0.0rc1)

I’ll comment on your thread to see if the version mismatch could be the solution :slight_smile:

Oh, and a FR on Streamlit’s side : https://github.com/streamlit/streamlit/issues/1134

Here, a codepen to test JS embedding on Bokeh 2.0.0 : https://codepen.io/andfanilo/pen/bGdgBze there is actually an error log in the debug view : Error: property Grid.axis wasn't declared

3 Likes

I’m also having this issue where Bokeh chart is not showing up in the app. Any new update on this topic would be great!

Hello @likemo and welcome to the forums !

The Bokeh 2 upgrade has been merged into Streamlit 0.57. I think Streamlit before 0.57 only works with Bokeh 1.0 and Streamlit 0.57+ only works with Bokeh 2.

Could you check your Bokeh/Streamlit versions ? And if it doesn’t work though the versions are ok, could you share a snippet of code so we can reproduce on our side :slight_smile: many thanks !

1 Like

Thanks for the warm welcome! And thanks to your help I was able to get it to work. Previously I was working with Bokeh 2 and Streamlit 0.56, but after upgrading Streamlit to 0.57 the Bokeh chart was able to display in the app.

1 Like

Hi there,

I have streamlit 0.79 and bokeh 2.3 and I can’t get streamlit show my bokeh charts. Is this issue resolved or is there anything I am missing? I am simply trying streamlit’s bokeh example. Thanks.

2 Likes

I had the same issue. Downgrade Bokeh to bokeh==2.2.2

pip install bokeh==2.2.2 

It will fix the issue.

6 Likes

Yeah, this is annoying. BokehJS (the frontend bokeh component) v2.3.0 is required if you’re using bokeh 2.3 from Python. But we’re currently unable to use BokehJS 2.3.0 or 2.3.1 because of a runtime error that it throws at import time.

I think (/hope) that this recently-merged BokehJS PR will solve that problem. It sounds like it will be in the Bokeh 2.4 release.

But currently, downgrading bokeh to 2.2.2 is still the only solution that works. :frowning:

2 Likes

Am having same issue