python-3.x - 我刚刚将 Python Bokeh 升级到 0.12.4 我收到错误 JSON 对象的字符串类型错误

标签 python-3.x bokeh

我刚刚将 Python Bokeh 升级到 0.12.4 我收到错误 JSON 对象的字符串类型错误。我没有任何本地静态 CDN 库。有一些信息here但这很令人困惑。有人对如何修复有一个简单的答案吗?

注意:我的 Bokeh 在 Jupyter 中运行良好。 Flask Web 嵌入案例失败:

script, div = components(plot) return render_template('graph.html',
script=script, div=div)

其中 graph.html 模板如下所示:

<link
    href="http://cdn.bokeh.org/bokeh/release/bokeh-0.12.4.min.css"
    rel="stylesheet" type="text/css">
<link
    href="http://cdn.bokeh.org/bokeh/release/bokeh-widgets-0.12.4.min.css"
    rel="stylesheet" type="text/css">

<script src="http://cdn.bokeh.org/bokeh/release/bokeh-0.12.4.min.js"></script>
<script src="http://cdn.bokeh.org/bokeh/release/bokeh-widgets-0.12.4.min.js"></script>

{{ script |safe }}

最佳答案

当我从 bokeh 0.12.6 升级到 bokeh 0.12.14 时,我的 django 模板中出现了同样的错误,所以我添加了相同的 bokeh 静态要求

<link rel="stylesheet" href="https://cdn.bokeh.org/bokeh/release/bokeh-0.12.14.min.css" type="text/css" />
<link rel="stylesheet" href="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-0.12.14.min.css" type="text/css" />
<link rel="stylesheet" href="https://cdn.bokeh.org/bokeh/release/bokeh-tables-0.12.14.min.css" type="text/css">

<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-0.12.14.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-api-0.12.14.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-widgets-0.12.14.min.js"></script>
<script type="text/javascript" src="https://cdn.bokeh.org/bokeh/release/bokeh-tables-0.12.14.min.js"></script>

关于python-3.x - 我刚刚将 Python Bokeh 升级到 0.12.4 我收到错误 JSON 对象的字符串类型错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49211950/

相关文章:

python - 使用 pandas 和 bokeh 构建排序的条形图

python - Bokeh : sizing_mode ="stretch_both" is not working in tabs

python - 更改用作函数全局范围的字典

Python检查字符串是否包含字典的任何键

python - 运行 Bokeh 服务器

python - 在 Bokeh 回调中切片数据以产生类似仪表板的交互

python - 在 Bokeh 中高效更新图像图以实现交互式可视化

javascript - python中的零填充右移

python - 在列表中排序列表

linux - 使用 python 代码从 bitbucket 存储库中提取数据的最佳方法