Python 3.13

ModuleNotFoundError: No module named 'aifc'

ModuleNotFoundError: No module named 'aifc'

What it means

aifc was removed from the standard library in Python 3.13 under PEP 594. It is commonly hit indirectly, because the removed sndhdr module and some speech libraries imported it.

Why it happens

PEP 594 removed nineteen legacy modules in Python 3.13, including aifc, sndhdr, sunau and chunk. Audio-handling code frequently touched several of them at once.

How to fix it

  1. Check whether your own code imports it at all: `grep -rn 'import aifc' .` — this error often comes from a dependency.
  2. For reading and writing AIFF files, use a maintained library such as `soundfile` (libsndfile bindings) or `pydub`.
  3. If a dependency is the importer, check for a release that dropped the import before you pin Python down to 3.12.
  4. Note that `sndhdr`, `sunau` and `chunk` were removed in the same release, so fixing only aifc may surface the next one.

Check configured patterns in your project

The free EOLkits scanner processes files in your browser and flags selected related patterns in supported IaC and dependency files. File names and contents are not uploaded; bounded aggregate file and finding counts may be sent. It is not a complete source or AWS-account scan.

Prefer a 10-second check? Paste your config into the free AWS EOL checker. Pasted input is not uploaded; bounded first-party usage events may be sent.

Primary source: https://docs.python.org/3/whatsnew/3.13.html

Inspect the $299 report sample and availability →