ImportError: No module named 'bokeh.layouts'

ImportError: No module named 'bokeh.layouts'

我正在尝试 运行 一些散景示例,当我导入 bokeh.layouts(从 ipython 解释器或在 jupyter 笔记本中)时,我收到以下错误: ImportError: No module named 'bokeh.layouts'.

我正在使用通过 conda install bokeh 安装的 python 3.5 和 bokeh 0.12.4。这有什么问题吗?

您的系统上安装了多个 python 或 python 环境,您实际 运行 的 python 与您的 运行 不同已经安装了散景。

作为一个具体示例,这是一种可能的情况,类似于我偶尔看到的情况:

  • Jupyter notebook 安装在 OS/system python 而不是 conda root env
  • Bokeh conda env 但 Jupyter 笔记本现在
  • 用户运行 notebook,这使用系统 python,它具有不同的散景版本(或完全 none)