audio
audio copied to clipboard
torchaudio/lib/libtorchaudio_sox.so, 0x0006): Library not loaded: @rpath/libsox.dylib
torchaudio/lib/libtorchaudio_sox.so, 0x0006): Library not loaded: @rpath/libsox.dylib
installed pip install sox not work
same problem for me. macos. already done pip install sox and brew install sox
I had the same issue. It seems the way sox is used in pytorch has changed for versions >= 2.0 https://pytorch.org/audio/2.1.0/torchaudio.html#i-o.
This worked for me:
- Make sure you have sox installed
brew install sox
- Set environment variable for torchaudio
export BUILD_SOX=1
- Uninstall current torch version and rollback to a 1.X version https://pytorch.org/get-started/previous-versions/. I used version 1.11.0 and it worked.
I think there's a way to still get it working with versions >=2.0 but not one I figured out. I think more info on related issues can be found here: https://github.com/pytorch/audio/issues/2950.
Linking brew's libsox.dylib to python virtual environment solved this issue for me
ln -s $HOME/homebrew/lib/libsox.dylib $HOME/miniconda3/envs/ENVIRONMENT_NAME/lib/libsox.dylib