Hello! New user here trying to (eventually) build an output html file with tabs coming from a pandas dataframe.
My first problem is that I can’t seem to import TabPanel from bokeh.models. Other imports from .models work just fine, I’ve restarted Anaconda and I’m using Python 3.8.8 and a fresh install of bokeh.
My code so far:
import pandas as pd
from bokeh.plotting import figure, output_file, save, show
from bokeh.models import HoverTool
from bokeh.models import ColumnDataSource
from bokeh.models import TabPanel, Tabs
p1 = figure(width=300, height=300)
p1.circle([1,2,3,4,5], [6,7,2,4,5], size=20, color=‘navy’, alpha=0.5)
tab1 = TabPanel(child=p1, title=‘Circle’)
p2 = figure(width=300, height=300)
p2.line([1,2,3,4,5], [6,7,2,4,5], line_width=3, color=‘navy’, alpha=0.5)
tab2 = TabPanel(child=p2, title=‘Line’)
show(Tabs(tabs=[tab1,tab2]))
And the error message:
ImportError: cannot import name ‘TabPanel’ from ‘bokeh.models’ (C:\Users\MYNAME\Anaconda3\lib\site-packages\bokeh\models_init_.py)
I’m hopeful that it’s just something silly/easy to fix, or that I’m just doing something wrong.
Thanks for the help!