louvain is a Python implementation of the Louvain algorithm for community detection in large networks, based on the igraph library. Current version is 0.8.2, with a relatively stable release cadence (last update 2024).
pip install louvainVerified import paths — ran on the pinned version, not inferred.
Basic community detection using the Louvain algorithm on a random graph.
Use pip install leidenalg and import leidenalg (also by same author, more efficient)
Run: pip install python-igraph
Ensure igraph is installed and imported before louvain