【发布时间】:2019-01-31 23:28:21
【问题描述】:
试图让 Altair 与 Jupyter Notebook 一起使用,我使用它安装了它
conda install -c conda-forge altair vega_datasets notebook vega
但是当我尝试做一个示例情节时
import altair as alt
from vega_datasets import data
# for the notebook only (not for JupyterLab) run this command once per session
alt.renderers.enable('notebook')
iris = data.iris()
alt.Chart(iris).mark_point().encode(
x='petalLength',
y='petalWidth',
color='species'
)
正如他们的quick start guide 所见,我明白了
ValueError:
To use the 'notebook' renderer, you must install the vega package
and the associated Jupyter extension.
See https://altair-viz.github.io/getting_started/installation.html
for more information.
即使我已经使用 Conda 安装了 vega。不过,我可以制作 vega 示例图。我无法启用 Jupyter 扩展,因为 Jupyter 说它不兼容。
感谢任何帮助。
【问题讨论】:
标签: jupyter-notebook vega altair