Paul Thomas
Paul Thomas

Reputation: 497

Bokeh Value error

Anyone came around the following Bokeh value error. Any quick fix?

File "C:\ProgramData\Anaconda3\lib\site-packages\bokeh\resources.py", line 218, in __init__
            "'inline', 'cdn', 'server(-dev)', 'relative(-dev)' or 'absolute(-dev)', got %r" % self.mode)

ValueError: wrong value for 'mode' parameter, expected 'inline', 'cdn', 'server(-dev)', 'relative(-dev)' or 'absolute(-dev)', got 'BOKEH_RESOURCES=inline'

Python code I am using is given below,

from bokeh.plotting import figure, show, output_file

from bokeh.resources import CDN

from bokeh.embed import file_html

x = elastic_Rest_y_disp
A = figure(title="Wing Station vs Shear Force along y direction",y_range=(500,38000),plot_width=900, plot_height=700,toolbar_location="left",toolbar_sticky=False)

A.xaxis.axis_label = "Wing Station"

A.yaxis.axis_label = "Force (lbs)"

A.line(x, elastic_Rest_CY, legend="elastic_Rest_CY",line_color="black", line_dash=[4, 4],line_width=2)
A.square(x, elastic_Rest_CY, legend="elastic_Rest_CY", fill_color=None, line_color="green") 

A.legend.location = "top_right"    

output_file("GFEM_vs_CB_elastic_y.html",**mode="inline"**, title="Wing Station vs Shear Force along y direction")

show(A)

Upvotes: 0

Views: 537

Answers (1)

bigreddot
bigreddot

Reputation: 34568

BOKEH_RESOURCES is an environment variable. It's a way to specify an override for resource from the command line, when you run your script. On a Linux system, you'd run something like:

BOKEH_RESOURCES=inline python myscript.py

i.e. not pass it as a parameter in Python code (which is what you appear to be doing).

I believe on Windows you would do:

set BOKEH_RESOURCES=inline

then

python myscript.py

Upvotes: 1

Related Questions