Hello,
I’ve been struggling with torchaudio since I migrated to my new macBook Pro.
The problem is the following: torchaudio can not initialize the sox backend when
- the Python environment is managed by
uv, - and I debug from PyCharm or VSCode (the two IDEs I use for Python, I did not test any other),
- even though
soxis installed and the scripts run perfectly from the terminal (with the environment managed byuv).
The issue seems related to uv as I don’t have any problem if I manage the environment manually with venv and pip.
More details in my issue on uv repo.
However, the problems seems related to my environment somehow:
- I did not encounter the issue on my previous computer (also a macBook Pro Apple Silicon).
- If I work in a bash session with a much simpler environment (I have a quite complicated
.zprofilefile but no.bash_profileor.profilefile), the problem is even worse as it appears even in scripts launched from the terminal with the environment managed byuv.
My questions are the following (I tried to look at the source code but couldn’t figure out the answers):
- How does
torchaudiolinks to thesoxbackend? - In what conditions does
torchaudio.list_audio_backends()return an empty list even thoughshutil.which("sox")returns the path tosoxproperly?
Thank you for your help ![]()