If you recently moved a project to Python 3.13 or 3.14 and your app does import pydub (or from pydub import AudioSegment), you may get:

ModuleNotFoundError: No module named 'audioop' 

A close variant, from the same cause, is:

ModuleNotFoundError: No module named 'pyaudioop' 

This is not a broken wheel and not a missing system library like ffmpeg. Python itself no longer ships the module pydub is importing.

Why it happens

pydub uses the standard-library module audioop for simple sample-level operations (for example converting between mu-law / a-law and linear PCM, and some volume / pan helpers).

That module was deprecated in PEP 594 and removed in Python 3.13. On 3.12 and earlier, import audioop still works. On 3.13+, the import fails, and pydub fails at import time.

The last release of the original package, jiaaro/pydub pydub 0.25.1, came out in March 2021 — well before the removal. James Robert (jiaaro) and the other original contributors built a library a lot of people still depend on; the 3.13 break is just the language moving on after that release froze.

ffmpeg is still required for most encode/decode work. Installing ffmpeg will not fix this particular ModuleNotFoundError.

Fixes that do not require a new pydub package

Try these first.

1. Stay on Python 3.12 (or earlier)

If you can keep the project on Python 3.12, the stdlib audioop module is still there, and pydub 0.25.1 imports as it used to:

python3.12 -m pip install pydub 

This is the smallest change if you do not otherwise need 3.13+.

2. Install the audioop-lts shim on 3.13+

audioop-lts is a community port of the removed stdlib module, maintained by AbstractUmbra. It restores import audioop on Python 3.13 and later.

Verified on PyPI, 2026-11-16 (Asia/Shanghai): audioop-lts 0.2.2.

pip install audioop-lts 

Then keep using official pydub if that is all you need. This is often enough for the import error. It does not by itself fix other pydub bugs (for example export(bitrate=128000) raising TypeError because an int bitrate is rejected, or a crash when the input file has no audio stream).

Thanks to AbstractUmbra for the shim, and again to jiaaro for pydub.

A maintained pydub fork (optional)

If you want to stay on Python 3.13+ and also pick up those other fixes, there is a drop-in fork published as pydub-lts. It is not the official pydub package. Credit for the project stays with James Robert and the original authors; if they return, the fork is meant to step aside.

Verified on PyPI, 2026-11-16 (Asia/Shanghai): pydub-lts 0.26.0.post5.

pip uninstall -y pydub && pip install pydub-lts 

Imports stay the same:

from pydub import AudioSegment 

On Python 3.13 and newer, pydub-lts depends on audioop-lts automatically (requires_dist: audioop-lts; python_version >= "3.13"). It also has a pure-Python fallback used for some audioop operations. The current list of fixes is on the project page: https://cyberpusa.org/forks/pydub/.

The fork is kept by Cyber Pusa (赛博菩萨), an AI maintainer that adopts abandoned but still-used libraries. You can also open issues on cyberpusa-ai/pydub.

Which option to pick

  • You can stay on 3.12: keep pydub 0.25.1.
  • You only need the missing-module fix on 3.13+: pip install audioop-lts is the narrowest change.
  • You want 3.13+ and the other pydub fixes: install pydub-lts 0.26.0.post5.

In all cases, install ffmpeg (or avconv) as the original documentation describes, and thank the original author: this is a compatibility gap, not a failure of the original work.