sndfile library not found after importing librosa

5,175 views
Skip to first unread message

Ikteaja Hasan

unread,
Aug 13, 2020, 6:04:33 PM8/13/20
to librosa


 Hello there,


Currently i am doing master's thesis on acoustic sound detection using Machine learning. Therefore ,I need librosa module for extracting feature from audio signals.I have installed librosa in an anaconda environment. I have installed librosa by using this command: "conda install -c conda-forge librosa"


it has been installed successfully.But when i am importing in jupyter notebook it is raising the above mentioned error(OSError: sndfile library not found).


I am a ssh client(windows pc). Accessing the jupyter notebook from a remote server from ML environment.



I would be really thankful for any kind of suggestions or help.



Capture.PNG

Vincent Lostanlen

unread,
Aug 13, 2020, 9:49:22 PM8/13/20
to Ikteaja Hasan, librosa
Hello,

can you please try
pip install soundfile



Sincerely,
Vincent.

--
You received this message because you are subscribed to the Google Groups "librosa" group.
To unsubscribe from this group and stop receiving emails from it, send an email to librosa+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/librosa/dde18a0b-fd72-495e-9ef4-1aca51d3c0a5o%40googlegroups.com.

Ikteaja Hasan

unread,
Aug 14, 2020, 7:20:36 AM8/14/20
to librosa

hey getting new error !!!!!!!!!!!!!!!!!!!!!!!! druing installation.

(mycondaenv) mhasan1@eddie:~/anaconda3/envs/mycondaenv/bin$ conda install -c conda-forge soundfile
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - soundfile

Current channels:

  - https://conda.anaconda.org/conda-forge/linux-64
  - https://conda.anaconda.org/conda-forge/noarch
  - https://conda.anaconda.org/bioconda/linux-64
  - https://conda.anaconda.org/bioconda/noarch
  - https://repo.anaconda.com/pkgs/main/linux-64
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-64
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.


from jupyter notebook:

!{sys.executable} -m pip install soundfile:

Errror:/bin/bash: {sys.executable}: command not found
----------------------------------------------------------------------------------

tob...@gmail.com

unread,
Aug 14, 2020, 12:37:46 PM8/14/20
to librosa
I believe Vincent wanted you to use pip install, not conda :-)

Remember, conda-forge is a conda collection maintained by the community, not by the anaconda people. conda-forge should only be used, when the official repos doesn't have the file, e.g. in the case with librosa.
However it seems like the official repo does have it? https://anaconda.org/conda-forge/pysoundfile

So you should be able to write, with your conda environment active of course, "conda install pysoundfile".

But, otherwise just do pip install soundfile" as Vincent suggested (or maybe even start with pip, since that's the first thing Vincent mentioned, and he might have more experience with it).

Ikteaja Hasan

unread,
Aug 15, 2020, 3:17:01 AM8/15/20
to librosa

 i used the as you the command as you  mentioned.Still its saying command not found error. @Tob

(mycondaenv) mhasan1@eddie:~/anaconda3/envs/mycondaenv$ conda install pysound

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError:
The following packages are not available from current channels:

  - pysound




-----------------------------------------------------------------------------------------------

On Friday, August 14, 2020 at 12:04:33 AM UTC+2, Ikteaja Hasan wrote:

tob...@gmail.com

unread,
Aug 15, 2020, 4:49:02 AM8/15/20
to librosa
I believe I wrote "conda install pysoundfile" ;-) However I see it doesn't work. Now I've fiddled around, and what you REALLY need to write is:

"conda install pysoundfile -c conda-forge"

:-)

Ikteaja Hasan

unread,
Aug 16, 2020, 8:25:09 AM8/16/20
to librosa
Hello Tob,

Please have a look i followed your instruction. still i m getting the same error after importing librosa in jupyter notebook.

(mycondaenv) mhasan1@eddie:~/anaconda3/envs/mycondaenv$ conda install pysoundfile -c conda-forge

Collecting package metadata (current_repodata.json): done
Solving environment: done

# All requested packages already installed.th

Again the error attachment is given bellow.

Capture.PNG












------------------------------------------------------------------------------------------------------------------

On Friday, August 14, 2020 at 12:04:33 AM UTC+2, Ikteaja Hasan wrote:
Message has been deleted

tob...@gmail.com

unread,
Aug 17, 2020, 4:12:23 AM8/17/20
to librosa
Please see this link https://tinyurl.com/yxuk4rvx.

Open the 5-10 first results in tabs and see if there's anything of relevance. I think you'll find your answer somewhere along the first 5 results ;)

If you don't find anything, let me know. :-)

Below, there's invisible, white text. It contains spoilers to the search. Select if you wanna miss out on all the fun and XP ponts:

Probably the problem you're having:

Librosa uses a few C-something libraries, that Linux systems might not have preinstalled. If you're

tob...@gmail.com

unread,
Aug 17, 2020, 4:14:31 AM8/17/20
to librosa
I thought I was smart with the white text, but it insists on making the link blue. Oh well.
Just to be sure, did you try what Vincent said? Otherwise, see my above post.

"pip install soundfile"
Reply all
Reply to author
Forward
0 new messages