Is it possible to install Altair package in Jupyter labs?

Did anyone use this visualization tool yet? https://altair-viz.github.io/getting_started/overview.html

Hi Marcel,

The Altair package is not running in the normal jupyter hub but runs fine in jupyterlab. So, you will have to launch jupyter lab.

  1. Start Jupyter lab
    jupyter lab --ip 0.0.0.0 --port 4040 --no-browser --notebook-dir=$HOME

  2. Wait for the URL to be printed. It would be something like this:

  1. Change the URL to the public URL:

In my case, I replaced the private IP address to the public IP address of the computer that you are logged in:
http://e.cloudxlab.com:4041/?token=eba5c47ef8535ce8ca83ddc23be6365fb86f4f9437cac8b2&token=eba5c47ef8535ce8ca83ddc23be6365fb86f4f9437cac8b2

  1. Open it in the browser

  2. Click on “Python3” notebook

  3. Copy-paste the following code:

    import altair as alt

    load a simple dataset as a pandas DataFrame

    from vega_datasets import data
    cars = data.cars()

    alt.Chart(cars).mark_point().encode(
    x=‘Horsepower’,
    y=‘Miles_per_Gallon’,
    color=‘Origin’,
    ).interactive()

  4. press shift+enter, it should look like the following: