{"id":46748,"library":"vega","title":"Vega (ipywidgets-based)","description":"A Jupyter widget that renders Vega 5 and Vega-Lite 4 specifications. Version 4.1.0 requires Python >=3.8 and works with Jupyter Notebook, JupyterLab, and VSCode. It is typically installed alongside a conda environment for the Vega dependencies. The library is actively maintained on GitHub under the Vega organization.","status":"active","version":"4.1.0","language":"python","source_language":"en","source_url":"https://github.com/vega/ipyvega","tags":["vega","vega-lite","jupyter","widget","visualization"],"install":[{"cmd":"pip install vega","lang":"bash","label":"PyPI install"},{"cmd":"conda install -c conda-forge vega","lang":"bash","label":"Conda install (recommended for full Vega dependencies)"}],"dependencies":[{"reason":"Required for the Jupyter widget integration","package":"ipywidgets","optional":false},{"reason":"Used for widget property handling","package":"traitlets","optional":false}],"imports":[{"note":"Older API used vega.widget, but vega now exports Vega directly","wrong":"from vega.widget import Vega","symbol":"Vega","correct":"from vega import Vega"},{"note":"Same as above; vega.widget was deprecated in early 4.x versions","wrong":"from vega.widget import VegaLite","symbol":"VegaLite","correct":"from vega import VegaLite"}],"quickstart":{"code":"from vega import VegaLite\n\ndata = [{'x': 1, 'y': 2}, {'x': 3, 'y': 4}]\nspec = {\n    '$schema': 'https://vega.github.io/schema/vega-lite/v4.json',\n    'data': {'values': data},\n    'mark': 'point',\n    'encoding': {\n        'x': {'field': 'x', 'type': 'quantitative'},\n        'y': {'field': 'y', 'type': 'quantitative'}\n    }\n}\nVegaLite(spec)","lang":"python","description":"Render a simple Vega-Lite scatter plot in a Jupyter notebook."},"warnings":[{"fix":"Change imports to `from vega import VegaLite` (or Vega).","message":"In version 4.0.0, the import path changed from vega.widget to vega. Old code using `from vega.widget import VegaLite` will break.","severity":"breaking","affected_versions":"<4.0.0"},{"fix":"Run `conda install -c conda-forge vega vega-lite` or manually include the JS via a notebook extension.","message":"The vega package on PyPI is a Jupyter widget; it does NOT install Vega or Vega-Lite JavaScript libraries. You must install them separately (conda-forge recommended) or the widget will fail silently.","severity":"gotcha","affected_versions":"all"},{"fix":"Upgrade to vega>=4 and use Vega-Lite 4+ specifications.","message":"The `vega` package version 3.x and earlier relied on an older widget API. The current 4.x line is incompatible with Vega-Lite 3 and below.","severity":"deprecated","affected_versions":"<4.0.0"}],"env_vars":null,"search_vec":"'3.8':22 '4':16 '4.1.0':19 '5':11 'activ':46 'alongsid':35 'base':4 'conda':37 'depend':42 'environ':38 'github':49 'instal':34 'ipywidget':3 'ipywidgets-bas':2 'jupyt':6,26,58 'jupyterlab':28 'librari':44 'lite':15,57 'maintain':47 'notebook':27 'organ':53 'python':21 'render':9 'requir':20 'specif':17 'typic':33 'vega':1,10,14,41,52,54,56 'vega-lit':13,55 'version':18 'visual':60 'vscode':30 'widget':7,59 'work':24","created_at":"2026-06-07T13:01:26.823146+00:00","updated_at":"2026-06-07T13:01:26.823146+00:00","problems":[{"fix":"Run `pip install vega` or `conda install -c conda-forge vega`.","cause":"The package is not installed in the current Python environment.","error":"ModuleNotFoundError: No module named 'vega'"},{"fix":"Upgrade vega to >=4.0.0: `pip install --upgrade vega` and use `from vega import VegaLite`.","cause":"Using an older version of vega (<4.0.0) where VegaLite was in vega.widget.","error":"ImportError: cannot import name 'VegaLite' from 'vega'"},{"fix":"Convert DataFrame to records: `spec['data'] = {'values': df.to_dict('records')}`.","cause":"Passing a pandas DataFrame directly as data; Vega expects a list of dicts.","error":"ValueError: The truth value of a DataFrame is ambiguous"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/vega/ipyvega","github":"https://github.com/vega/ipyvega","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["analytics"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}