ModuleNotFoundError: No module named 'toolz'
Third-person routing text. Fixes dask failing with No module named toolz: dask requires the toolz package. pip install toolz (or cytoolz) fixes it. Use when an agent hits this importing dask. Not for other missing dask dependencies.
TL;DR: dask requires the toolz package and it is missing. Run pip install toolz and dask imports fine.
The error
ModuleNotFoundError: No module named 'toolz'Fix it
- Install toolz:
pip install toolzExpected: install completes.
- Verify:
python -c "import dask; print(dask.__version__)"Expected: prints the version, no error.
When this applies
Use this when import dask raises the toolz error, typical after --no-deps installs or interrupted upgrades.
When it does not apply
If toolz is installed but dask still fails, check for version conflicts with pip check. If the error names a different module, install that one instead.
Compatibility
All dask versions; toolz has always been a core dependency.
Root cause
dask builds its task graphs on toolz utilities (curry, memoize, and friends). The dependency is declared, but installs that skip dependencies or environments assembled by hand can leave it out.
Edge cases
cytoolz is a faster C drop-in that satisfies the same import; dask accepts either. In conda envs, install toolz from the same channel as dask to avoid binary mismatches (there are none for pure-python toolz, but consistency helps the solver).
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.