librosa.load: file not found error on loading a file

Related searches

I am trying to use librosa to analyze .wav files. I started with creating a list which stores the names of all the .wav files it detected.

data_dir = '/Users/raghav/Desktop/FSU/summer research'
audio_file = glob(data_dir + '/*.wav')

I can see the names of all the files in the list 'audio_file'. But when I load any of the audio file, it gives me file not found error.

audio, sfreq = lr.load(audio_file[0])

error output:

Traceback (most recent call last):
  File "read_audio.py", line 10, in <module>
    audio, sfreq = lr.load(audio_file[1])
  File "/usr/local/lib/python3.7/site-packages/librosa/core/audio.py", line 119, in load
    with audioread.audio_open(os.path.realpath(path)) as input_file:    
  File "/usr/local/lib/python3.7/site-packages/audioread/__init__.py", line 107, in audio_open
    backends = available_backends()
  File "/usr/local/lib/python3.7/site-packages/audioread/__init__.py", line 86, in available_backends
    if ffdec.available():
  File "/usr/local/lib/python3.7/site-packages/audioread/ffdec.py", line 108, in available
    creationflags=PROC_FLAGS,
  File "/usr/local/lib/python3.7/site-packages/audioread/ffdec.py", line 94, in popen_multiple
    return subprocess.Popen(cmd, *args, **kwargs)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 775, in __init__
    restore_signals, start_new_session)
  File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/subprocess.py", line 1522, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)

FileNotFoundError: [Errno 2] No such file or directory: 'avconv': 'avconv'

Two things:

  1. It looks like you are using Homebrew
  2. avconv is not in your path

Assuming, you have never installed it, you should be able to solve this simply by installing it. I.e. run:

$ brew install libav

(see here)

If avconv is already installed, you probably need to look into your PATH environment and check whether it is in the path.

That said, using a system-wide Python as installed by Homebrew is a bad idea, because it does not quickly let you change Python versions and dependency sets. It all becomes one big mess within weeks.

One (among multiple) solutions for this is to use miniconda. It quickly lets you activate Python interpreters with defined dependency sets.

So to really solve the issue, I'd recommend to install miniconda and create a plain Python 3.6 environment:

$ conda create -n librosa_env python=3.6

Activate the environment:

$ source activate librosa_env

Then add the conda-forge channel (a repository that contains many libraries like librosa):

$ conda config --add channels conda-forge

Then install librosa:

$ conda install librosa

By installing librosa this way, conda should take care of all dependencies, incl. libav.

OSError: file not found � Issue #899 � librosa/librosa � GitHub, Get the file path to the included audio example filename = librosa.util. example_audio_. OGG file at a different location and make sure that the loading still fails? sr = librosa.load(filename) Traceback (most recent call last): File "<stdin>", installed not through conda, it always reports 'file not found' error. That error suggests librosa is unable to find FFMPEG executables, of which avconv is an example. When not converting different samplerates, FFMPEG is often not needed. You can try to specify the sample size to be the original of the audio file during load ()

That error suggests librosa is unable to find FFMPEG executables, of which avconv is an example.

When not converting different samplerates, FFMPEG is often not needed. You can try to specify the sample size to be the original of the audio file during load()

lr.load giving FileNotFoundError: [Errno 2] No such file or directory , lr.load giving FileNotFoundError: [Errno 2] No such file or directory: 'avconv': / 56246836/librosa-load-file-not-found-error-on-loading-a-file Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

Upgrading audioread to 2.1.8 fixed this issue for me. The bugfix can be inspected here: https://github.com/beetbox/audioread/commit/8c4e236fda38ce1d1f6dafc4715074a790e62849

librosa.load: file not found error on loading a file, I am trying to use librosa to analyze .wav files. I started with creating a list which stores the names of all the .wav files it detected. Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

绵阳斯懿新材料科技有限公司, load: file not found error on loading a file. I am trying to use librosa to analyze . wav files. I started with creating a list which stores the names of all the .wav files� Not only does it seem to be more robust and work with a wide range of filetypes (like ogg), but for me, it's loading even wav files much much faster than librosa.load. Copy link Quote reply Member

Python Examples of librosa.load, This page shows Python examples of librosa.load. Project: Sound-Recognition -Tutorial Author: JasonZhang156 File: ids = id_reg_exp.findall(filename) if not ids: # The file name does not match the pattern containing is pretty fast but normalization is a problem #signal = signal.numpy().flatten() #reader = io_methods. Dismiss Join GitHub today. GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.

Out of the box installation of librosa cannot read .wav file. I have not tried it on .mp3 or .ogg. But this is unacceptable. This is supposed to be an audio processing library and simply not being able to read .wav files renders the library obsolete.

Comments
  • Installing avcon worked. Do you mean that installing python on the system and using is directly is a bad practice? rather use virtual environment for different projects to installs different dependencies? thank you for the solution.
  • Exactly—that’s what I’d recommend.
  • I tried that but it didn't work. I even tried to load the example audio file they give (nbviewer.jupyter.org/github/librosa/librosa/blob/master/…), but even that is giving me the same error.