散景值错误
Bokeh Value error
有人解决了以下散景值错误。有什么快速修复方法吗?
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)
BOKEH_RESOURCES
是一个 环境变量 。当您 运行 您的脚本时,这是一种从命令行指定资源覆盖的方法。在 Linux 系统上,你会 运行 像这样:
BOKEH_RESOURCES=inline python myscript.py
即不 将其作为参数传递到Python 代码中(您似乎正在这样做)。
我相信 Windows 你会这样做:
set BOKEH_RESOURCES=inline
然后
python myscript.py
有人解决了以下散景值错误。有什么快速修复方法吗?
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)
BOKEH_RESOURCES
是一个 环境变量 。当您 运行 您的脚本时,这是一种从命令行指定资源覆盖的方法。在 Linux 系统上,你会 运行 像这样:
BOKEH_RESOURCES=inline python myscript.py
即不 将其作为参数传递到Python 代码中(您似乎正在这样做)。
我相信 Windows 你会这样做:
set BOKEH_RESOURCES=inline
然后
python myscript.py