Stability-AI / stable-audio-tools

Generative models for conditional audio generation
MIT License
2.5k stars 230 forks source link

OSError: sndfile library not found #128

Open TacoByte opened 1 month ago

TacoByte commented 1 month ago

M1 Max Sonoma

nicecube@nicecubes-MacBook-Pro stable-audio-tools % python3 ./run_gradio.py 
Traceback (most recent call last):
  File "/Users/nicecube/Library/Python/3.11/lib/python/site-packages/soundfile.py", line 142, in <module>
    raise OSError('sndfile library not found')
OSError: sndfile library not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/nicecube/stable-audio-tools/./run_gradio.py", line 2, in <module>
    from stable_audio_tools.interface.gradio import create_ui
  File "/Users/nicecube/stable-audio-tools/stable_audio_tools/interface/gradio.py", line 10, in <module>
    from aeiou.viz import audio_spectrogram_image
  File "/Users/nicecube/Library/Python/3.11/lib/python/site-packages/aeiou/viz.py", line 26, in <module>
    from librosa import power_to_db
  File "/Users/nicecube/Library/Python/3.11/lib/python/site-packages/librosa/__init__.py", line 209, in <module>
    from . import core
  File "/Users/nicecube/Library/Python/3.11/lib/python/site-packages/librosa/core/__init__.py", line 6, in <module>
    from .audio import *  # pylint: disable=wildcard-import
    ^^^^^^^^^^^^^^^^^^^^
  File "/Users/nicecube/Library/Python/3.11/lib/python/site-packages/librosa/core/audio.py", line 8, in <module>
    import soundfile as sf
  File "/Users/nicecube/Library/Python/3.11/lib/python/site-packages/soundfile.py", line 162, in <module>
    _snd = _ffi.dlopen(_os.path.join(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: cannot load library '/Users/nicecube/Library/Python/3.11/lib/python/site-packages/_soundfile_data/libsndfile.dylib': dlopen(/Users/nicecube/Library/Python/3.11/lib/python/site-packages/_soundfile_data/libsndfile.dylib, 0x0002): tried: '/Users/nicecube/Library/Python/3.11/lib/python/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/nicecube/Library/Python/3.11/lib/python/site-packages/_soundfile_data/libsndfile.dylib' (no such file), '/Users/nicecube/Library/Python/3.11/lib/python/site-packages/_soundfile_data/libsndfile.dylib' (no such file)
hushaudio commented 1 month ago

Hi Tacobyte.

First, you should really error dump into chatgpt instead of GitHub. You should also read the error even tho I know it’s always painful.

The problem is you need to install libsndfile, which the error says python can’t find (I think you use brew to install it on Mac) -> detailed helpful instructions can be found here (it’s free): chatgpt.com

Just copy and paste the error into chatgpt and talk to it, it’ll guide you through the install process. Less wait time than GitHub. You got this. Enjoy!

hushaudio commented 1 month ago

If you just want to check out stable audio open and don’t want to deal with the python stuff, you can also use this free vst plugin and model engine I created at Audialab:

https://audialab.com/products/deep-sampler-2