ModuleNotFoundError: No module named 'fastparquet.cencoding'
Third-person routing text. Fixes fastparquet failing with No module named fastparquet.cencoding: the compiled C extension did not build. Reinstall fastparquet so the extension compiles, or use a wheel. Use when an agent hits this importing fastparquet. Not for pure-python fastparquet issues.
TL;DR: fastparquet's compiled speed-up module did not build during install. Reinstall fastparquet with a working C compiler (or grab a prebuilt wheel) and the import works.
The error
ModuleNotFoundError: No module named 'fastparquet.cencoding'Fix it
Reinstall fastparquet, letting pip pick a prebuilt wheel:
pip install --force-reinstall fastparquetExpected: installs a wheel that already contains cencoding.
- If pip builds from source instead, install a C compiler first (Debian/Ubuntu:
sudo apt install build-essential; then rerun the reinstall). Expected: the build compiles cencoding. Verify:
python -c "import fastparquet; print(fastparquet.__version__)"Expected: prints the version, no error.
When this applies
Use this when import fastparquet raises the cencoding error, typical on platforms without a matching wheel.
When it does not apply
If the error is plain No module named 'fastparquet', just install it. If cencoding imports but reads are wrong, that is a data issue, not this one.
Compatibility
fastparquet installs that compile the optional C extension; wheels for major platforms already include it.
Root cause
fastparquet ships an optional Cython extension (cencoding) for speed. Source installs without a compiler silently skip it, and the import of the extension module then fails.
Edge cases
fastparquet works in pure-python mode without cencoding, just slower; the import error only bites because the package tries the extension first. Pinning fastparquet in CI avoids surprise source builds.