OSError: file not found
See original GitHub issueDescription
Description
I face a problem when I follow the tutorial:
# Beat tracking example
from __future__ import print_function
import librosa
# 1. Get the file path to the included audio example
filename = librosa.util.example_audio_file()
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
y, sr = librosa.load(filename)
# 3. Run the default beat tracker
tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sr)
print('Estimated tempo: {:.2f} beats per minute'.format(tempo))
# 4. Convert the frame indices of beat events into timestamps
beat_times = librosa.frames_to_time(beat_frames, sr=sr)
print('Saving output to beat_times.csv')
librosa.output.times_csv('beat_times.csv', beat_times)
Steps/Code to Reproduce
Expected Results
It may run without error
Actual Results
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/zhongyi/anaconda3/envs/tf-torch/lib/python3.6/site-packages/librosa/core/audio.py", line 119, in load
with audioread.audio_open(os.path.realpath(path)) as input_file:
File "/home/zhongyi/anaconda3/envs/tf-torch/lib/python3.6/site-packages/audioread/__init__.py", line 111, in audio_open
return ffdec.FFmpegAudioFile(path)
File "/home/zhongyi/anaconda3/envs/tf-torch/lib/python3.6/site-packages/audioread/ffdec.py", line 150, in __init__
self._get_info()
File "/home/zhongyi/anaconda3/envs/tf-torch/lib/python3.6/site-packages/audioread/ffdec.py", line 206, in _get_info
raise IOError('file not found')
OSError: file not found
Versions
>>> import platform; print(platform.platform())
Linux-4.15.0-51-generic-x86_64-with-debian-buster-sid
>>> import sys; print("Python", sys.version)
Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:00)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)]
>>> import numpy; print("NumPy", numpy.__version__)
NumPy 1.13.3
>>> import scipy; print("SciPy", scipy.__version__)
SciPy 1.1.0
>>> import librosa; print("librosa", librosa.__version__)
librosa 0.6.3
Issue Analytics
- State:
- Created 4 years ago
- Comments:27 (13 by maintainers)
Top Results From Across the Web
OSError: file not found - python - Stack Overflow
I had this same issue. It cannot locate the .txt file because you're in the wrong directory. Make sure that where you're trying...
Read more >Python FileNotFoundError: [Errno 2] No such file or directory ...
The Python FileNotFoundError: [Errno 2] No such file or directory error is often raised by the os library. This error tells you that...
Read more >OSError: File not found - Odoo
Hi,. In the manifest file inside the data you have specified a file, but in the given path the file is not there....
Read more >Python giving "file not found" error with both file in same ...
I'm using windows 7, and I have the file in the same directory as the program I'm running. I got this error, so...
Read more >How do I solve the file not found error in Python? - CodeProject
Either the path is wrong (and "USER" in there does look unlikely) or the file is not where you expected, or not called...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Are you sure that the file exists?
Hi, I am getting this same problem as well, a file not found error. I tried installing in a conda environment using
conda install -c conda-forge librosa
. I also made sure thatffmpeg
is installed (4.3.1). Here’s the full message: