Search code examples
htmlpropertiesmodelsbokeh

Why Bokeh has the following error msg?


I am trying to follow along the udemy tutorial and ran into the following error: Bokeh Error attempted to retrieve property value for property without value specification in the html by running the code below.

Does anyone have a clue as why it happened? Thanks!!

    from bokeh.plotting import figure
    from bokeh.io import output_file, show, gridplot
    #from bokeh.sampledata.periodic_table import elements
    from bokeh.models import Range1d, PanTool, ResetTool, HoverTool, 
         ColumnDataSource, LabelSet
    import pandas
    from bokeh.models.annotations import Span#assess object within 
         annotations

    #prepare the output file
    output_file("layout.html")

    x1,y1=list(range(0,10)),list(range(10,20))

    #create a new plot
    f1=figure(width=250, plot_height=250, title="Circles")
    f1.circle(x1, y1, size=10, color="navy", alpha=0.5)

    #create a span annotation (a vertical reference line)
    span_4=Span(location=4,dimension='height',line_color='grenn', 
                line_width=2)

    #define where to add the span_4 object instance, add_layout method
    f1.add_layout(span_4)

    #create a box annotation

    box_2_6=BoxAnnotation(left=2,right=6,fill_color="firebrick",
    fill_alpha=0.3)
    f1.add_layout(box_2_6)

    #show the results
    show(f1)

Solution

  • It appears to be because of a typo - line_color='grenn' should be line_color='green'. You're right that it's an unhelpful error message though. I'll try to open a GH issue about it.