More Itertools
raw JSON → 10.8.0 verified Tue May 12 auth: no python install: verified quickstart: verified
A Python package offering additional routines for working with iterables, extending beyond the standard itertools module. Current version: 10.8.0. Maintained with regular updates to enhance functionality and performance.
pip install more-itertools Common errors
error ModuleNotFoundError: No module named 'more_itertools' ↓
cause The 'more-itertools' package is not installed in your Python environment.
fix
Install the package using pip:
pip install more-itertools error AttributeError: module 'more_itertools' has no attribute '__version__' ↓
cause The `more_itertools` module does not expose its version via a `__version__` attribute directly within the module itself, unlike some other packages.
fix
To get the installed version, use
pkg_resources or importlib.metadata (Python 3.8+): import pkg_resources; pkg_resources.get_distribution('more-itertools').version or import importlib.metadata; importlib.metadata.version('more-itertools') error ImportError: cannot import name 'pairwise' from 'itertools' ↓
cause The `pairwise` function was added to the standard `itertools` module in Python 3.10. If you are using an older Python version (e.g., 3.9 or below), `pairwise` is only available in the `more-itertools` library.
fix
Either upgrade your Python version to 3.10 or newer, or import
pairwise from more_itertools: from more_itertools import pairwise (after ensuring more-itertools is installed). error ValueError: chunked(): incomplete batch ↓
cause This error occurs when using `more_itertools.chunked()` (or `sliced()`) with `strict=True`, and the length of the input iterable is not perfectly divisible by the chunk size `n`.
fix
Either ensure the input iterable's length is a multiple of
n, or remove strict=True to allow the last chunk to be shorter, or handle incomplete batches by setting incomplete='fill' or incomplete='ignore' (for grouper). Warnings
breaking Python 3.7 support dropped in version 10.0.0 due to its end of life on 2023-06-27. ↓
fix Upgrade to Python 3.8 or later.
breaking The 'first_true()' function now returns 'None' by default, changing its previous behavior. ↓
fix Update code to handle 'None' as a default return value.
deprecated The 'batched()' function is now an alias for 'itertools.batched' in Python 3.12 and later. ↓
fix Use 'itertools.batched' directly in Python 3.12+.
gotcha The 'chunked()' and 'sliced()' functions now accept a 'strict' parameter, affecting their behavior. ↓
fix Review and adjust usage of 'strict' parameter in 'chunked()' and 'sliced()' functions.
Install compatibility verified last tested: 2026-05-12
python os / libc status wheel install import disk
3.10 alpine (musl) - - 0.03s 18.3M
3.10 slim (glibc) - - 0.02s 19M
3.11 alpine (musl) - - 0.06s 20.2M
3.11 slim (glibc) - - 0.04s 21M
3.12 alpine (musl) - - 0.06s 12.0M
3.12 slim (glibc) - - 0.05s 13M
3.13 alpine (musl) - - 0.05s 11.6M
3.13 slim (glibc) - - 0.05s 12M
3.9 alpine (musl) - - 0.01s 17.8M
3.9 slim (glibc) - - 0.01s 18M
Imports
- chunked
from more_itertools import chunked - windowed
from more_itertools import windowed
Quickstart verified last tested: 2026-04-23
from more_itertools import chunked
iterable = [0, 1, 2, 3, 4, 5, 6, 7, 8]
result = list(chunked(iterable, 3))
print(result)
# Output:
# [[0, 1, 2], [3, 4, 5], [6, 7, 8]]