Skip to content

ImportError: No module named 'pyaudioop' on Python 3.13 – audioop removed, no pip package available #863

@space-contributes

Description

@space-contributes

Downgrading Python does not work

## Description

Running Pydub on Python 3.13 fails at import time due to missing `audioop` / `pyaudioop`.

Error:

ModuleNotFoundError: No module named 'pyaudioop'


Traceback points to:

File "pydub/utils.py", line 16, in
import pyaudioop as audioop


## Environment

- Python version: 3.13.0
- OS: Windows 10
- Pydub version: 0.25.1 (latest from PyPI)

## Steps to Reproduce

1. Install Python 3.13
2. `pip install pydub`
3. Run:
   ```python
   from pydub import AudioSegment

Expected Behavior

Pydub should import successfully without requiring unavailable modules.

Actual Behavior

Fails with:

ModuleNotFoundError: No module named 'pyaudioop'

Notes

  • Python 3.13 removed the stdlib audioop module (PEP 594).

  • Pydub currently tries to import pyaudioop, but:

    • audioop is gone from stdlib
    • pyaudioop is not installable via pip on Python 3.13 (no wheels, build fails).
  • This leaves Pydub completely broken on Python 3.13 with no pip-installable fix.

Possible Fixes

  • Vendor or bundle the audioop functionality Pydub depends on
  • Or mark pyaudioop as a required dependency and ensure wheels are published for Python 3.13
  • Or add a graceful fallback so Pydub works without audioop features

POSSIBLE PR

OLD

#import pyaudioop as audioop

NEW

try:
import audioop
except ImportError:
try:
import pyaudioop as audioop
except ImportError:
audioop = None # Gracefully disable audioop-dependent features


Add pyaudioop as an optional dependency (so builds don’t break when no wheel is available):

[project.optional-dependencies]
audio = ["pyaudioop>=0.1.0"]

Workarounds

  • Downgrading to Python 3.12 resolves the issue
  • There is currently no pip-installable way to get audioop/pyaudioop on Python 3.13

---

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions