【发布时间】:2019-08-21 20:24:54
【问题描述】:
_我正在尝试使用 Bokeh 制作条形图以输出为 .html 文件。简单的绘图一切正常,但由于某种原因,当我尝试运行以下代码时:
from bokeh.charts import Bar, output_file, show
from bokeh.sampledata.autompg import autompg as df
p = Bar(df, label='yr', values='mpg', agg='mean',
title="Average MPG by YR")
output_file("bar.html")_
我最终得到一个错误提示:
ImportError: 没有名为“bokeh.charts”的模块
我已经通过 pip 安装了 Pandas、Numpy,它们都可以使用 help('modules') 命令找到。我知道高级散景图需要 Pandas,它是通过 Pip 安装的
熊猫版本:0.20.3 散景版本:0.12.9 Python 是 3.4.2 版
我也尝试过不同的导入命令,“from bokeh import *”等,但似乎没有任何效果。
【问题讨论】:
标签: python python-3.x pandas bokeh raspberry-pi3