cannot instal soundfile in datalab












0















i want install sndfile to successfully install another package (musdb), but when I tried following instructions on https://cloud.google.com/datalab/docs/how-to/adding-libraries



!pip install sndfile


It gives me the following error:



{Collecting sndfile
Using cached https://files.pythonhosted.org/packages/db/ce/797cacd78490aa9de2e0e119491079d380e2fbbd7a1c5057c9fb2120a643/sndfile-0.2.0.tar.gz
Requirement already satisfied: cffi>=1.0.0 in /usr/local/envs/py2env/lib/python2.7/site-packages (from sndfile) (1.11.5)
Requirement already satisfied: pycparser in /usr/local/envs/py2env/lib/python2.7/site-packages (from cffi>=1.0.0->sndfile) (2.18)
Building wheels for collected packages: sndfile
Running setup.py bdist_wheel for sndfile ... error
Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-YWj7At --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/sndfile
copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
running build_ext
generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
creating build/temp.linux-x86_64-2.7
building 'sndfile._sndfile' extension
creating build/temp.linux-x86_64-2.7/build
creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c
build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1




Failed building wheel for sndfile
Running setup.py clean for sndfile
Failed to build sndfile
Installing collected packages: sndfile
Running setup.py install for sndfile ... error
Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-FMQzpS/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/sndfile
copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
running build_ext
generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
creating build/temp.linux-x86_64-2.7
building 'sndfile._sndfile' extension
creating build/temp.linux-x86_64-2.7/build
creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-FMQzpS/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-NZx2D1/sndfile/}


I tried to google around, it either suggested to download via conda, which seems difficult with datalab, or with the following command



sudo apt-get install libsndfile1


which gives me a syntax error in datalab.





I need this library since I am trying to import musdb and after installing, when I try to import, it gives me the following error:



import musdb

OSErrorTraceback (most recent call last)




 in <module> .   ()
----> 1 import musdb

/usr/local/envs/py2env/lib/python2.7/site-packages/musdb/__init__.py in <module>()
1 from __future__ import print_function
----> 2 from .audio_classes import Track, Source, Target
3 from os import path as op
4 from six.moves import map
5 import multiprocessing

/usr/local/envs/py2env/lib/python2.7/site-packages/musdb/audio_classes.py in <module>()
2 from __future__ import division
3 import os
----> 4 import soundfile as sf
5 import numpy as np
6 import stempeg

/usr/local/envs/py2env/lib/python2.7/site-packages/soundfile.py in <module>()
140 _libname = _find_library('sndfile')
141 if _libname is None:
--> 142 raise OSError('sndfile library not found')
143 _snd = _ffi.dlopen(_libname)
144 except OSError:

OSError: sndfile library not found


any insights are greatly appreciated!










share|improve this question



























    0















    i want install sndfile to successfully install another package (musdb), but when I tried following instructions on https://cloud.google.com/datalab/docs/how-to/adding-libraries



    !pip install sndfile


    It gives me the following error:



    {Collecting sndfile
    Using cached https://files.pythonhosted.org/packages/db/ce/797cacd78490aa9de2e0e119491079d380e2fbbd7a1c5057c9fb2120a643/sndfile-0.2.0.tar.gz
    Requirement already satisfied: cffi>=1.0.0 in /usr/local/envs/py2env/lib/python2.7/site-packages (from sndfile) (1.11.5)
    Requirement already satisfied: pycparser in /usr/local/envs/py2env/lib/python2.7/site-packages (from cffi>=1.0.0->sndfile) (2.18)
    Building wheels for collected packages: sndfile
    Running setup.py bdist_wheel for sndfile ... error
    Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-YWj7At --python-tag cp27:
    running bdist_wheel
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
    creating build/temp.linux-x86_64-2.7
    building 'sndfile._sndfile' extension
    creating build/temp.linux-x86_64-2.7/build
    creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
    gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c
    build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
    build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1




    Failed building wheel for sndfile
    Running setup.py clean for sndfile
    Failed to build sndfile
    Installing collected packages: sndfile
    Running setup.py install for sndfile ... error
    Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-FMQzpS/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
    copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
    running build_ext
    generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
    creating build/temp.linux-x86_64-2.7
    building 'sndfile._sndfile' extension
    creating build/temp.linux-x86_64-2.7/build
    creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
    gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
    build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
    compilation terminated.
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
    Command "/usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-FMQzpS/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-NZx2D1/sndfile/}


    I tried to google around, it either suggested to download via conda, which seems difficult with datalab, or with the following command



    sudo apt-get install libsndfile1


    which gives me a syntax error in datalab.





    I need this library since I am trying to import musdb and after installing, when I try to import, it gives me the following error:



    import musdb

    OSErrorTraceback (most recent call last)




     in <module> .   ()
    ----> 1 import musdb

    /usr/local/envs/py2env/lib/python2.7/site-packages/musdb/__init__.py in <module>()
    1 from __future__ import print_function
    ----> 2 from .audio_classes import Track, Source, Target
    3 from os import path as op
    4 from six.moves import map
    5 import multiprocessing

    /usr/local/envs/py2env/lib/python2.7/site-packages/musdb/audio_classes.py in <module>()
    2 from __future__ import division
    3 import os
    ----> 4 import soundfile as sf
    5 import numpy as np
    6 import stempeg

    /usr/local/envs/py2env/lib/python2.7/site-packages/soundfile.py in <module>()
    140 _libname = _find_library('sndfile')
    141 if _libname is None:
    --> 142 raise OSError('sndfile library not found')
    143 _snd = _ffi.dlopen(_libname)
    144 except OSError:

    OSError: sndfile library not found


    any insights are greatly appreciated!










    share|improve this question

























      0












      0








      0








      i want install sndfile to successfully install another package (musdb), but when I tried following instructions on https://cloud.google.com/datalab/docs/how-to/adding-libraries



      !pip install sndfile


      It gives me the following error:



      {Collecting sndfile
      Using cached https://files.pythonhosted.org/packages/db/ce/797cacd78490aa9de2e0e119491079d380e2fbbd7a1c5057c9fb2120a643/sndfile-0.2.0.tar.gz
      Requirement already satisfied: cffi>=1.0.0 in /usr/local/envs/py2env/lib/python2.7/site-packages (from sndfile) (1.11.5)
      Requirement already satisfied: pycparser in /usr/local/envs/py2env/lib/python2.7/site-packages (from cffi>=1.0.0->sndfile) (2.18)
      Building wheels for collected packages: sndfile
      Running setup.py bdist_wheel for sndfile ... error
      Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-YWj7At --python-tag cp27:
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-2.7
      creating build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
      running build_ext
      generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
      creating build/temp.linux-x86_64-2.7
      building 'sndfile._sndfile' extension
      creating build/temp.linux-x86_64-2.7/build
      creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
      gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c
      build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
      build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
      compilation terminated.
      error: command 'gcc' failed with exit status 1




      Failed building wheel for sndfile
      Running setup.py clean for sndfile
      Failed to build sndfile
      Installing collected packages: sndfile
      Running setup.py install for sndfile ... error
      Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-FMQzpS/install-record.txt --single-version-externally-managed --compile:
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-2.7
      creating build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
      running build_ext
      generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
      creating build/temp.linux-x86_64-2.7
      building 'sndfile._sndfile' extension
      creating build/temp.linux-x86_64-2.7/build
      creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
      gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
      build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
      compilation terminated.
      error: command 'gcc' failed with exit status 1

      ----------------------------------------
      Command "/usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-FMQzpS/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-NZx2D1/sndfile/}


      I tried to google around, it either suggested to download via conda, which seems difficult with datalab, or with the following command



      sudo apt-get install libsndfile1


      which gives me a syntax error in datalab.





      I need this library since I am trying to import musdb and after installing, when I try to import, it gives me the following error:



      import musdb

      OSErrorTraceback (most recent call last)




       in <module> .   ()
      ----> 1 import musdb

      /usr/local/envs/py2env/lib/python2.7/site-packages/musdb/__init__.py in <module>()
      1 from __future__ import print_function
      ----> 2 from .audio_classes import Track, Source, Target
      3 from os import path as op
      4 from six.moves import map
      5 import multiprocessing

      /usr/local/envs/py2env/lib/python2.7/site-packages/musdb/audio_classes.py in <module>()
      2 from __future__ import division
      3 import os
      ----> 4 import soundfile as sf
      5 import numpy as np
      6 import stempeg

      /usr/local/envs/py2env/lib/python2.7/site-packages/soundfile.py in <module>()
      140 _libname = _find_library('sndfile')
      141 if _libname is None:
      --> 142 raise OSError('sndfile library not found')
      143 _snd = _ffi.dlopen(_libname)
      144 except OSError:

      OSError: sndfile library not found


      any insights are greatly appreciated!










      share|improve this question














      i want install sndfile to successfully install another package (musdb), but when I tried following instructions on https://cloud.google.com/datalab/docs/how-to/adding-libraries



      !pip install sndfile


      It gives me the following error:



      {Collecting sndfile
      Using cached https://files.pythonhosted.org/packages/db/ce/797cacd78490aa9de2e0e119491079d380e2fbbd7a1c5057c9fb2120a643/sndfile-0.2.0.tar.gz
      Requirement already satisfied: cffi>=1.0.0 in /usr/local/envs/py2env/lib/python2.7/site-packages (from sndfile) (1.11.5)
      Requirement already satisfied: pycparser in /usr/local/envs/py2env/lib/python2.7/site-packages (from cffi>=1.0.0->sndfile) (2.18)
      Building wheels for collected packages: sndfile
      Running setup.py bdist_wheel for sndfile ... error
      Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-YWj7At --python-tag cp27:
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-2.7
      creating build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
      running build_ext
      generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
      creating build/temp.linux-x86_64-2.7
      building 'sndfile._sndfile' extension
      creating build/temp.linux-x86_64-2.7/build
      creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
      gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c
      build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
      build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
      compilation terminated.
      error: command 'gcc' failed with exit status 1




      Failed building wheel for sndfile
      Running setup.py clean for sndfile
      Failed to build sndfile
      Installing collected packages: sndfile
      Running setup.py install for sndfile ... error
      Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-FMQzpS/install-record.txt --single-version-externally-managed --compile:
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-2.7
      creating build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
      copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
      running build_ext
      generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
      creating build/temp.linux-x86_64-2.7
      building 'sndfile._sndfile' extension
      creating build/temp.linux-x86_64-2.7/build
      creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
      gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
      build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
      compilation terminated.
      error: command 'gcc' failed with exit status 1

      ----------------------------------------
      Command "/usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('rn', 'n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-FMQzpS/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-NZx2D1/sndfile/}


      I tried to google around, it either suggested to download via conda, which seems difficult with datalab, or with the following command



      sudo apt-get install libsndfile1


      which gives me a syntax error in datalab.





      I need this library since I am trying to import musdb and after installing, when I try to import, it gives me the following error:



      import musdb

      OSErrorTraceback (most recent call last)




       in <module> .   ()
      ----> 1 import musdb

      /usr/local/envs/py2env/lib/python2.7/site-packages/musdb/__init__.py in <module>()
      1 from __future__ import print_function
      ----> 2 from .audio_classes import Track, Source, Target
      3 from os import path as op
      4 from six.moves import map
      5 import multiprocessing

      /usr/local/envs/py2env/lib/python2.7/site-packages/musdb/audio_classes.py in <module>()
      2 from __future__ import division
      3 import os
      ----> 4 import soundfile as sf
      5 import numpy as np
      6 import stempeg

      /usr/local/envs/py2env/lib/python2.7/site-packages/soundfile.py in <module>()
      140 _libname = _find_library('sndfile')
      141 if _libname is None:
      --> 142 raise OSError('sndfile library not found')
      143 _snd = _ffi.dlopen(_libname)
      144 except OSError:

      OSError: sndfile library not found


      any insights are greatly appreciated!







      python google-cloud-datalab libsndfile






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 24 '18 at 18:07









      llllll

      365214




      365214
























          1 Answer
          1






          active

          oldest

          votes


















          1














          Datalab comes with conda ready to use in Python 2 and 3 environments. This means you should be able to get what you need with the following:



          %%bash
          conda install -y libsndfile ffmpeg
          pip install musdb





          share|improve this answer























            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53461012%2fcannot-instal-soundfile-in-datalab%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Datalab comes with conda ready to use in Python 2 and 3 environments. This means you should be able to get what you need with the following:



            %%bash
            conda install -y libsndfile ffmpeg
            pip install musdb





            share|improve this answer




























              1














              Datalab comes with conda ready to use in Python 2 and 3 environments. This means you should be able to get what you need with the following:



              %%bash
              conda install -y libsndfile ffmpeg
              pip install musdb





              share|improve this answer


























                1












                1








                1







                Datalab comes with conda ready to use in Python 2 and 3 environments. This means you should be able to get what you need with the following:



                %%bash
                conda install -y libsndfile ffmpeg
                pip install musdb





                share|improve this answer













                Datalab comes with conda ready to use in Python 2 and 3 environments. This means you should be able to get what you need with the following:



                %%bash
                conda install -y libsndfile ffmpeg
                pip install musdb






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 30 '18 at 19:19









                rbauerrbauer

                685




                685
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53461012%2fcannot-instal-soundfile-in-datalab%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Feedback on college project

                    Futebolista

                    Albești (Vaslui)