任何人都会遇到以下Bokeh值错误。有什么快速的解决办法吗?
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代码,
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)发布于 2017-09-18 01:10:31
BOKEH_RESOURCES是一个环境变量。这是一种在运行脚本时从命令行为资源指定覆盖的方法。在Linux系统上,您可以运行如下内容:
BOKEH_RESOURCES=inline python myscript.py也就是说,在Python代码中不将它作为参数传递(这似乎就是您正在做的事情)。
我相信在Windows上你会这样做:
set BOKEH_RESOURCES=inline然后
python myscript.pyhttps://stackoverflow.com/questions/46269935
复制相似问题