Installation issues (sndfile library not found)

459 views
Skip to first unread message

Matthew Graham

unread,
Mar 12, 2020, 9:50:48 PM3/12/20
to Magenta Discuss
I am not a data scientist so a lot of this is new to me. (hope this is the right area of the forum for this and is an easy fix)
I have just duel booted my pc to Ubuntu 18.4.3. I am trying to run the music transformer code, I have got magenta installed (pytest gives no errors) and I am trying to do the code on the github instructions for data generation using google cloud. It communicates with the cloud for a few minutes until it throws this error. I have been scouring the internet for solutions and have manually installed soundfile, libsndfile-1, libsndfile-1-dev and pysndfile. All don't work. However when i import soundfile in spyder it works fine so no idea why there is even a problem. I am new to linux so have no ideas where to even start with this. Any help will be really appreciated. been stuck and made no progress for 2 days now :( hopefully I have just missed out a step, no idea what this error even means (other than some file is struggling to translate music to numbers.

pc is: AMD Ryzen 7 3750H, 8Gb ram, gtx 1660 ti



I0313 00:23:52.700119 140433954961152 dataflow_runner.py:223] 2020-03-13T00:23:49.497Z: JOB_MESSAGE_ERROR: Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/apache_beam/internal/pickler.py", line 279, in loads
    return dill.loads(s)
  File "/usr/local/lib/python3.7/site-packages/dill/_dill.py", line 275, in loads
    return load(file, ignore, **kwds)
  File "/usr/local/lib/python3.7/site-packages/dill/_dill.py", line 270, in load
    return Unpickler(file, ignore=ignore, **kwds).load()
  File "/usr/local/lib/python3.7/site-packages/dill/_dill.py", line 472, in load
    obj = StockUnpickler.load(self)
  File "/usr/local/lib/python3.7/site-packages/dill/_dill.py", line 827, in _import_module
    return getattr(__import__(module, None, None, [obj]), obj)
  File "/usr/local/lib/python3.7/site-packages/magenta/__init__.py", line 34, in <module>
    import magenta.music.audio_io
  File "/usr/local/lib/python3.7/site-packages/magenta/music/audio_io.py", line 23, in <module>
    import librosa
  File "/usr/local/lib/python3.7/site-packages/librosa/__init__.py", line 12, in <module>
    from . import core
  File "/usr/local/lib/python3.7/site-packages/librosa/core/__init__.py", line 126, in <module>
    from .audio import *  # pylint: disable=wildcard-import
  File "/usr/local/lib/python3.7/site-packages/librosa/core/audio.py", line 10, in <module>
    import soundfile as sf
  File "/usr/local/lib/python3.7/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 "/usr/local/lib/python3.7/site-packages/dataflow_worker/batchworker.py", line 649, in do_work
    work_executor.execute()
  File "/usr/local/lib/python3.7/site-packages/dataflow_worker/executor.py", line 176, in execute
    op.start()
  File "apache_beam/runners/worker/operations.py", line 590, in apache_beam.runners.worker.operations.DoOperation.start
  File "apache_beam/runners/worker/operations.py", line 591, in apache_beam.runners.worker.operations.DoOperation.start
  File "apache_beam/runners/worker/operations.py", line 592, in apache_beam.runners.worker.operations.DoOperation.start
  File "apache_beam/runners/worker/operations.py", line 223, in apache_beam.runners.worker.operations.Operation.start
  File "apache_beam/runners/worker/operations.py", line 227, in apache_beam.runners.worker.operations.Operation.start
  File "apache_beam/runners/worker/operations.py", line 538, in apache_beam.runners.worker.operations.DoOperation.setup
  File "apache_beam/runners/worker/operations.py", line 543, in apache_beam.runners.worker.operations.DoOperation.setup
  File "/usr/local/lib/python3.7/site-packages/apache_beam/internal/pickler.py", line 283, in loads
    return dill.loads(s)
  File "/usr/local/lib/python3.7/site-packages/dill/_dill.py", line 275, in loads
    return load(file, ignore, **kwds)
  File "/usr/local/lib/python3.7/site-packages/dill/_dill.py", line 270, in load
    return Unpickler(file, ignore=ignore, **kwds).load()
  File "/usr/local/lib/python3.7/site-packages/dill/_dill.py", line 472, in load
    obj = StockUnpickler.load(self)
  File "/usr/local/lib/python3.7/site-packages/dill/_dill.py", line 827, in _import_module
    return getattr(__import__(module, None, None, [obj]), obj)
  File "/usr/local/lib/python3.7/site-packages/magenta/__init__.py", line 34, in <module>
    import magenta.music.audio_io
  File "/usr/local/lib/python3.7/site-packages/magenta/music/audio_io.py", line 23, in <module>
    import librosa
  File "/usr/local/lib/python3.7/site-packages/librosa/__init__.py", line 12, in <module>
    from . import core
  File "/usr/local/lib/python3.7/site-packages/librosa/core/__init__.py", line 126, in <module>
    from .audio import *  # pylint: disable=wildcard-import
  File "/usr/local/lib/python3.7/site-packages/librosa/core/audio.py", line 10, in <module>
    import soundfile as sf
  File "/usr/local/lib/python3.7/site-packages/soundfile.py", line 142, in <module>
    raise OSError('sndfile library not found')
OSError: sndfile library not found


Thanks a whole bunch :)


Ian Simon

unread,
Mar 12, 2020, 10:37:06 PM3/12/20
to Matthew Graham, Magenta Discuss
The data generation is a little bit broken right now.  You can try the workaround described in this issue: https://github.com/tensorflow/magenta/issues/1631

-Ian

--
Magenta project: magenta.tensorflow.org
To post to this group, send email to magenta...@tensorflow.org
To unsubscribe from this group, send email to magenta-discu...@tensorflow.org
---
To unsubscribe from this group and stop receiving emails from it, send an email to magenta-discu...@tensorflow.org.

Matthew Graham

unread,
Mar 28, 2020, 12:14:48 PM3/28/20
to Magenta Discuss, matthewm...@gmail.com
Thanks a lot this was a life saver! Wouldnt have figured this out without the help
To unsubscribe from this group, send email to magenta...@tensorflow.org
---
To unsubscribe from this group and stop receiving emails from it, send an email to magenta...@tensorflow.org.
Reply all
Reply to author
Forward
0 new messages