#1030596 python3-altair: altair_viewer is required for show a chart in a window

Package:
python3-altair
Source:
python3-altair
Submitter:
Francesco Muzio
Date:
2023-02-05 13:57:04 UTC
Severity:
normal
Tags:
#1030596#5
Date:
2023-02-05 13:54:14 UTC
From:
To:
Dear Maintainer,

latest version of Altair library requires an extra package

"altair_viewer" to using the method show() on a chart (this methos was
implemented since version 4.1.0)


I have tried a simple example code:


import altair as alt
import numpy as np
import pandas as pd
x, y = np.meshgrid(range(-5, 5), range(-5, 5))
z = x ** 2 + y ** 2
source = pd.DataFrame({'x': x.ravel(),
                     'y': y.ravel(),
                     'z': z.ravel()})
chart=alt.Chart(source).mark_rect().encode(
    x='x:O',
    y='y:O',
    color='z:Q'
)
chart.show()


and the last instruction show me this error:


Traceback (most recent call last):

  File "/usr/lib/python3/dist-packages/altair/vegalite/v4/api.py", line 1789,
in show

    import altair_viewer  # type: ignore

ModuleNotFoundError: No module named 'altair_viewer'


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/usr/lib/python3/dist-packages/altair/vegalite/v4/api.py", line 1791,
in show

    raise ValueError(

ValueError: show() method requires the altair_viewer package. See
http://github.com/altair-viz/altair_viewer
----

Versions of packages python3-altair depends on:
ii  python3              3.9.2-3
ii  python3-entrypoints  0.3-5
ii  python3-jinja2       2.11.3-1
ii  python3-jsonschema   3.2.0-3
ii  python3-numpy        1:1.19.5-1
ii  python3-pandas       1.1.5+dfsg-2
ii  python3-toolz        0.9.0-1.1

python3-altair recommends no packages.

Versions of packages python3-altair suggests: