{"id":21400,"library":"gravis","title":"gravis","description":"Gravis is an interactive graph visualization library for Python. It generates HTML/CSS/JS visualizations that can be embedded in notebooks or served as standalone web apps. Current version 0.1.0 requires Python >=3.5. Released infrequently.","status":"active","version":"0.1.0","language":"python","source_language":"en","source_url":"https://github.com/robert-haas/gravis/","tags":["graph visualization","interactive","networkx","jupyter","html"],"install":[{"cmd":"pip install gravis","lang":"bash","label":"Install gravis"}],"dependencies":[{"reason":"Required for interactive display in Jupyter notebooks (notebook or lab)","package":"ipython","optional":true}],"imports":[{"note":"gv is a module, not a class; use 'import gravis as gv' and then call gv.xxx","wrong":"from gravis import gv","symbol":"gv","correct":"import gravis as gv"},{"note":"d3 is a submodule, not directly importable","wrong":"from gravis import d3","symbol":"gv.d3","correct":"import gravis as gv; gv.d3(...)"},{"note":"vis is a submodule, not directly importable","wrong":"from gravis import vis","symbol":"gv.vis","correct":"import gravis as gv; gv.vis(...)"}],"quickstart":{"code":"import gravis as gv\nimport networkx as nx\nG = nx.Graph()\nG.add_edge('a', 'b')\n# For Jupyter: use gv.d3(G) or gv.vis(G)\n# For standalone web app: gv.d3(G, use_standalone=True)\nfig = gv.d3(G)\nfig.display()","lang":"python","description":"Basic usage: create a NetworkX graph, then visualize with gravis."},"warnings":[{"fix":"Ensure input is a NetworkX Graph, DiGraph, etc.","message":"The 'graph' module (gv.d3 or gv.vis) expects a NetworkX graph. Using other graph types may cause unexpected errors.","severity":"gotcha","affected_versions":"all"},{"fix":"Change to 'import gravis as gv'.","message":"The old import pattern 'from gravis import gv' does not work. Always use 'import gravis as gv'.","severity":"deprecated","affected_versions":"0.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install gravis' to install the package.","cause":"gravis is not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'gravis'"},{"fix":"Use 'import gravis as gv' then 'gv.d3' or 'gv.vis'.","cause":"Incorrect import: using 'import gravis' then 'gravis.gv' which doesn't exist.","error":"AttributeError: module 'gravis' has no attribute 'gv'"},{"fix":"Pass a valid NetworkX graph object (e.g., nx.Graph()).","cause":"Input to gv.d3 or gv.vis is not a NetworkX graph.","error":"TypeError: expected graph object"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}