Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderer issue after upgrading to v3 #1420

Closed
humanoftheforest opened this issue Apr 9, 2019 · 10 comments
Closed

renderer issue after upgrading to v3 #1420

humanoftheforest opened this issue Apr 9, 2019 · 10 comments

Comments

@humanoftheforest
Copy link

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

@jakevdp
Copy link
Collaborator

jakevdp commented Apr 9, 2019

The Vega-Lite 3 renderer is built-in to JupyterLab, (added in jupyterlab/jupyterlab#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.

@jakevdp
Copy link
Collaborator

jakevdp commented Apr 9, 2019

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.

@humanoftheforest
Copy link
Author

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

@humanoftheforest
Copy link
Author

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!

@stonebig
Copy link
Contributor

is it compatible with jupyterlab-0.35.5 ?

@jakevdp
Copy link
Collaborator

jakevdp commented Apr 26, 2019

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

@deisi
Copy link
Contributor

deisi commented May 6, 2019

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

@jakevdp
Copy link
Collaborator

jakevdp commented May 6, 2019

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.

@rsgoodwin
Copy link

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!

@jakevdp
Copy link
Collaborator

jakevdp commented May 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants