Pau*_*sta 5 vega jupyter-notebook altair
试图让 Altair 与 Jupyter Notebook 一起工作,我使用
conda install -c conda-forge altair vega_datasets notebook vega
Run Code Online (Sandbox Code Playgroud)
但是当我尝试做一个示例图时
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'
)
Run Code Online (Sandbox Code Playgroud)
正如他们的快速入门指南中所见,我明白了
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.
Run Code Online (Sandbox Code Playgroud)
即使我已经使用 Conda 安装了 vega。不过,我可以制作 vega 示例图。我无法启用 Jupyter 扩展,因为 Jupyter 说它不兼容。
任何帮助表示赞赏。
jak*_*vdp 10
对于当前版本的 altair(2.2 版),请使用
conda install -c conda-forge vega=1.3
Run Code Online (Sandbox Code Playgroud)
或者
pip install vega==1.3
Run Code Online (Sandbox Code Playgroud)
然后重启笔记本。
在vegaPython扩展这个星期被错误地更新只支持维加-精简版3.0,这是尚未公布,因此尚未被Altair的支持。
有关初始错误报告,请参阅https://github.com/altair-viz/altair/issues/1114。
| 归档时间: |
|
| 查看次数: |
6751 次 |
| 最近记录: |