Spaces:
Runtime error

Startup fails on Python 3.13: gradio imports pydub, pydub imports audioop (removed from the stdlib)

#17
by nootxlm - opened

This Space currently fails at startup with the traceback ending in:

File "/usr/local/lib/python3.13/site-packages/pydub/utils.py", line 14, in <module>
    import audioop
ModuleNotFoundError: No module named 'audioop'
...
File "/usr/local/lib/python3.13/site-packages/pydub/utils.py", line 16, in <module>
    import pyaudioop as audioop
ModuleNotFoundError: No module named 'pyaudioop'

The chain is: app.py imports gradio, gradio's processing_utils imports pydub, and pydub needs the audioop stdlib module. audioop was removed in Python 3.13, and this Space's runtime is Python 3.13 — the README sets no python_version, so the platform default moved to 3.13 under it. requirements.txt currently contains only openai, so nothing supplies the replacement module.

Two small fixes, either is enough:

  1. Add audioop-lts to requirements.txt (the maintained backport that provides audioop on 3.13+), or
  2. Pin the runtime in the README front-matter, e.g. python_version: 3.12, where audioop still exists.

Option 1 is the more durable one, since the platform default will keep moving. The same failure is affecting other Spaces that import gradio on 3.13, so the pin travels well.

Sign up or log in to comment