Altair: renderer issue after upgrading to v3

Created on 9 Apr 2019  路  10Comments  路  Source: altair-viz/altair

Love the package and the approach. I have successfully used version 2, but I am having renderer issues after upgrading to version 3. Perhaps my real problem is that I don't use git and so don't deeply understand version control and therefore don't know where the documentation lives for version 3.

I am running altair 3.0.0rc1, jupyterlab 0.35.4, python 3.6.8

import altair as alt
alt.renderers.enable('jupyterlab')
cars=alt.datasets.load_dataset('cars')

alt.Chart(data=cars).mark_point().encode(
    x='Horsepower:Q',
    y='Miles_per_Gallon:Q'
)

gets me:

<VegaLite 3 object>

If you see this message, it means the renderer has not been properly enabled
for the frontend that you are using. For more information, see
https://altair-viz.github.io/user_guide/troubleshooting.html

The link goes to the version 2.4.1 documentation, which alludes to having at least jupyterlab 0.32, which I do.
My question probably betrays my shallow understanding, but hopefully there are other shy lurkers who I'm speaking for as well.

Many thanks in advance,
Vinod

Most helpful comment

The Vega-Lite 3 renderer is built-in to JupyterLab, (added in https://github.com/jupyterlab/jupyterlab/pull/6133) but that addition has not yet made it into a release.

Until the next JupyterLab release, I'd suggest using Altair v3 with another frontend, such as Jupyter Notebook or Colab.

All 10 comments

The Vega-Lite 3 renderer is built-in to JupyterLab, (added in https://github.com/jupyterlab/jupyterlab/pull/6133) but that addition has not yet made it into a release.

Until the next JupyterLab release, I'd suggest using Altair v3 with another frontend, such as Jupyter Notebook or Colab.

Oh, and sorry about the docs being unhelpful. Once Altair 3 is actually released, we'll make certain the docs are relevant to Altair 3.

Got it. That is very helpful to understand. Thanks!

As a follow-up, with the release of jupyterlab 1.0.0a3 yesterday, I was able to update jupyterlab and use Altair v3 successfully. It's worked great so far!

is it compatible with jupyterlab-0.35.5 ?

No, 0.35.5 still only has the vega-lite 2 renderer.

35.6 still not has it. At least it is not working as of right now. As an alternative I found it easier to install jupyterlab from github and use this instead. So do:

git clone https://github.com/jupyterlab/jupyterlab.git
cd jupyterlab
pip install --user .

and then start it wih:

~/.local/bin/jupyter-lab

I installed jupyterlab as user because I can later on remove it and it wont conflict with user system wide installation. I can also always start the system wide (stable) version with /usr/bin/jupyter-lab

35.6 still not has it.

Correct. As mentioned above and in the documentation, version 1.0 or later is required for Altair 3.

install jupyterlab from github and use this instead

There's no need to clone the jupyter repo; you can update to the prerelease with

pip install --user -U --pre jupyterlab

or by targeting the explicit version you want to install:

pip install --user jupyterlab==1.0.0a3

To avoid installing system-wide, I'd recommend using a virtualenv or conda env rather than a --user install.

Hi - I get the identical error even when using jupyter notebook (i.e. not jupyter lab). I'm on windows 10 and using chrome. My environment is below.

I can try installing the pre-release jupyterlab, however, should we expect altair to render in jupyter notebooks? I also tried each setting each of these renderers without luck:

['colab', 'default', 'json', 'jupyterlab', 'kaggle', 'nteract']

Used a virtual env and only installed the bare minimum from conda forge.

conda install -c conda-forge altair vega_datasets jupyterlab

env:

Name Version Build Channel
altair 3.0.1 py37_0 conda-forge
attrs 19.1.0 py_0 conda-forge
backcall 0.1.0 py_0 conda-forge
bleach 3.1.0 py_0 conda-forge
ca-certificates 2019.3.9 hecc5488_0 conda-forge
certifi 2019.3.9 py37_0 conda-forge
colorama 0.4.1 py_0 conda-forge
decorator 4.4.0 py_0 conda-forge
defusedxml 0.5.0 py_1 conda-forge
entrypoints 0.3 py37_1000 conda-forge
intel-openmp 2019.3 203
ipykernel 5.1.1 py37h39e3cac_0 conda-forge
ipython 7.5.0 py37h39e3cac_0 conda-forge
ipython_genutils 0.2.0 py_1 conda-forge
jedi 0.13.3 py37_0 conda-forge
jinja2 2.10.1 py_0 conda-forge
jsonschema 3.0.1 py37_0 conda-forge
jupyter_client 5.2.4 py_3 conda-forge
jupyter_core 4.4.0 py_0 conda-forge
jupyterlab 0.35.6 py37_0 conda-forge
jupyterlab_server 0.2.0 py_0 conda-forge
libblas 3.8.0 10_mkl conda-forge
libcblas 3.8.0 10_mkl conda-forge
liblapack 3.8.0 10_mkl conda-forge
libsodium 1.0.16 h2fa13f4_1001 conda-forge
m2w64-gcc-libgfortran 5.3.0 6
m2w64-gcc-libs 5.3.0 7
m2w64-gcc-libs-core 5.3.0 7
m2w64-gmp 6.1.0 2
m2w64-libwinpthread-git 5.0.0.4634.697f757 2
markupsafe 1.1.1 py37hfa6e2cd_0 conda-forge
mistune 0.8.4 py37hfa6e2cd_1000 conda-forge
mkl 2019.3 203
msys2-conda-epoch 20160418 1
nbconvert 5.5.0 py_0 conda-forge
nbformat 4.4.0 py_1 conda-forge
notebook 5.7.8 py37_0 conda-forge
numpy 1.16.3 py37h873a0b8_0 conda-forge
openssl 1.1.1b hfa6e2cd_2 conda-forge
pandas 0.24.2 py37h6538335_0 conda-forge
pandoc 2.7.2 0 conda-forge
pandocfilters 1.4.2 py_1 conda-forge
parso 0.4.0 py_0 conda-forge
pickleshare 0.7.5 py37_1000 conda-forge
pip 19.1.1 py37_0 conda-forge
prometheus_client 0.6.0 py_0 conda-forge
prompt_toolkit 2.0.9 py_0 conda-forge
pygments 2.4.0 py_0 conda-forge
pyrsistent 0.15.2 py37hfa6e2cd_0 conda-forge
python 3.7.3 hb12ca83_0 conda-forge
python-dateutil 2.8.0 py_0 conda-forge
pytz 2019.1 py_0 conda-forge
pywinpty 0.5.5 py37_1000 conda-forge
pyzmq 18.0.1 py37he7828b0_1 conda-forge
send2trash 1.5.0 py_0 conda-forge
setuptools 41.0.1 py37_0 conda-forge
six 1.12.0 py37_1000 conda-forge
sqlite 3.26.0 hfa6e2cd_1001 conda-forge
terminado 0.8.2 py37_0 conda-forge
testpath 0.4.2 py_1001 conda-forge
toolz 0.9.0 py_1 conda-forge
tornado 6.0.2 py37hfa6e2cd_0 conda-forge
traitlets 4.3.2 py37_1000 conda-forge
vc 14 0 conda-forge
vega_datasets 0.7.0 py_0 conda-forge
vs2015_runtime 14.0.25420 0 conda-forge
wcwidth 0.1.7 py_1 conda-forge
webencodings 0.5.1 py_1 conda-forge
wheel 0.33.4 py37_0 conda-forge
wincertstore 0.2 py37_1002 conda-forge
winpty 0.4.3 4 conda-forge
zeromq 4.3.1 he025d50_1000 conda-forge

Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fischcheng picture fischcheng  路  4Comments

pabloinsente picture pabloinsente  路  3Comments

floringogianu picture floringogianu  路  3Comments

DentonGentry picture DentonGentry  路  3Comments

jtbaker picture jtbaker  路  3Comments