Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 互动Bokeh应用程序中的Widgets.py_Python_Flask_Bokeh - Fatal编程技术网

Python 互动Bokeh应用程序中的Widgets.py

Python 互动Bokeh应用程序中的Widgets.py,python,flask,bokeh,Python,Flask,Bokeh,我的目标是运行一个简单的交互式Bokeh应用程序 #import libraries from bokeh.io import curdoc from bokeh.models.widgets import TextInput, Button, Paragraph from bokeh.layouts import layout #create widgets text_input=TextInput(value="World") button=Button(label="Generate T

我的目标是运行一个简单的交互式Bokeh应用程序

#import libraries
from bokeh.io import curdoc
from bokeh.models.widgets import TextInput, Button, Paragraph
from bokeh.layouts import layout

#create widgets
text_input=TextInput(value="World")
button=Button(label="Generate Text")
output=Paragraph()

def update():
    output.text="Hello " + text_input.value

button.on_click(update)
lay_out=layout([[button,text_input],[output]])
curdoc().add_root(lay_out)
我通过键入来运行我的文件

python -m bokeh serve widgets.py
Bokeh服务器开始运行

2017-06-14 17:22:26,293 Starting Bokeh server version 0.12.5
2017-06-14 17:22:26,309 Starting Bokeh server on port 5006 with applications at
paths ['/widgets']
2017-06-14 17:22:26,309 Starting Bokeh server with process id: 7804
然后我转到带有url的web浏览器:


什么也没发生。任何指导都将不胜感激。提前谢谢。

龙卷风4.5在博克0.12.5之后出现,但不兼容并破坏了一切。我猜这就是你的问题(符合描述)。Bokeh0.12.6昨天发布,并修复了该问题。因此,假设是这种情况,您可以:

  • 升级你的Bokeh版本
  • 降低你的龙卷风版本

该错误告诉您,当有人加载(
GET
s)根(
/
)页面时,运行的代码中存在异常。你需要找出错误的原因。你能发布更多细节吗?如果没有,请查看是否可以启用调试日志您是否在示例中指定的同一端口上运行bokeh服务器<代码>http://localhost:5006/bkapp@Peter:我发现错误:烧瓶正在呈现“embed.html”,而当前尚未创建。这就是代码有另一个错误的原因:“jinja2.exceptions.TemplateNotFound:embed.html”让我来处理这个问题。谢谢你的指导,谢谢你及时的建议。我已将我的Bokeh包更新为0.12.6。现在我可以运行我的bokeh服务器了。