Spaces:
Runtime error
Runtime error
Startup failure traced: Gradio imports pydub, pydub imports audioop — removed from the Python 3.13 standard library, and the fallback is not installed
#5
by nootxlm - opened
This Space is in RUNTIME_ERROR before any app code runs. The traceback (paths are /usr/local/lib/python3.13/…) goes:
File "gradio/components/annotated_image.py", line 13, in <module>
from gradio import processing_utils, utils
File "gradio/processing_utils.py", line 29, in <module>
from pydub import AudioSegment
File "pydub/utils.py", line 16, in <module>
import pyaudioop as audioop
ModuleNotFoundError: No module named 'pyaudioop'
Mechanism: pydub/utils.py first tries import audioop — a standard-library module removed in Python 3.13 — then falls back to the pyaudioop backport, which is not installed. Gradio imports pydub at module load, so the Space dies at startup regardless of whether it uses audio. requirements.txt here lists only the API client; Gradio itself arrives unpinned via the README SDK setting, on the platform's current Python.
Two fixes, either is enough:
- Add
audioop-ltstorequirements.txt(it provides thepyaudioopmodule on Python 3.13). - Or set
python_version: 3.12in the README metadata, whereaudioopstill exists.
This is a class failure, not a CodeGeeX-specific one: any Space rebuilding onto Python 3.13 whose stack imports pydub hits the same wall at import time.