Importerror with bokeh

Hi everyone !
I’m currently trying to deploy my app and I keep receiving this error :

File "/home/appuser/venv/lib/python3.9/site-packages/streamlit/runtime/scriptrunner/", line 565, in _run_script
    exec(code, module.__dict__)File "/app/pyckpocket---machine-learning-et-bookmakers/", line 5, in <module>
    from dataviz_streamlit import datavizFile "/app/pyckpocket---machine-learning-et-bookmakers/", line 8, in <module>
    from bokeh.models.widgets import Panel, Tabs

I already have a packages.txt file in my repo with “libgl1” in it.

Didn’t find the answer in any other topic.

Thank you for your help !

This is probably the reason and solution:

Hi !
Thank you for your answer.

I’m having issues installing the last version of bokeh.
I do “conda install -c bokeh bokeh” in Anaconda Powershell but it’s uploading 2.4.3 version instead of 3.0.3.
Can you help me again ?

Ah, i forgot, there was something about bokeh… :face_with_hand_over_mouth:
I think Streamlit is only compatible with Bokeh version 2.4.3.
You would have to adjust your Bokeh code parts based on Bokeh 2.4.3, then it should work together with Streamlit.

I quickly started a virtual env and installed bokeh==2.4.3 and this gave me no error:

from bokeh.models.widgets import Panel
from bokeh.models.widgets import Tabs

Therefore i think, no changes in your code required, if you pin the version to bokeh==2.4.3

I already had this error with bokeh version 2.4.3…
I’m not sure I understand what I have to do here…

So I figured out how to install bokeh 3.0.3
Instead of

from bokeh.models.widgets import Panel
from bokeh.models.widgets import Tabs

I did

from bokeh.models import TabPanel

like you first suggested.

And it worked !

Thank you very much for your help !