ipysigma

raw JSON →
0.24.6 verified Mon Apr 27 auth: no python

A Jupyter widget using sigma.js to render interactive networks. Current version: 0.24.6. Releases are frequent with major version bumps indicating breaking changes.

pip install ipysigma
error ModuleNotFoundError: No module named 'ipysigma'
cause The package is not installed.
fix
Run pip install ipysigma.
error ImportError: cannot import name 'Sigma' from 'ipysigma'
cause Using an older version of ipysigma where the main class is named differently (e.g., sigma or SigmaWidget).
fix
Upgrade to the latest version: pip install --upgrade ipysigma and use from ipysigma import Sigma.
error Javascript error adding output! ReferenceError: sigma is not defined
cause The sigma.js JavaScript library is not loaded, often because Jupyter widgets extensions are missing.
fix
Install ipywidgets and enable the extensions: pip install ipywidgets and jupyter nbextension enable --py widgetsnbextension for classic notebook, or jupyter labextension install @jupyter-widgets/jupyterlab-manager for JupyterLab.
breaking Version 0.24.0 changed the API: the main class is now `Sigma` (capital S) instead of `sigma` or `SigmaWidget`. Old imports will break.
fix Use `from ipysigma import Sigma`.
deprecated The `SigmaWidget` class was deprecated in 0.23.0 and removed in 0.24.0.
fix Replace `SigmaWidget` with `Sigma`.
gotcha The `Sigma` widget requires Jupyter notebook or JupyterLab with the proper extension installed. In JupyterLab, you may need to run `jupyter labextension install @jupyter-widgets/jupyterlab-manager` if not already present.
fix Ensure ipywidgets and the JupyterLab manager are installed: `pip install ipywidgets` and `jupyter labextension install @jupyter-widgets/jupyterlab-manager`.
gotcha The `layout` parameter in `Sigma` expects a string identifier from sigma.js (e.g., 'circle', 'random', 'forceatlas2'). If you pass an incorrect name, the layout may silently fall back to default.
fix Use only supported layout names: 'circle', 'random', 'forceatlas2'.

Creates an interactive sigma.js network visualization from a NetworkX graph in a Jupyter notebook.

from ipysigma import Sigma
import networkx as nx

G = nx.karate_club_graph()
Sigma(G, node_color='club', edge_color='weight').render()