Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: cannot import librosa library --> OSError: cannot load library 'libsndfile.so' :

I am running my python code on the cloud using paperspace gradient. My code utilizes the librosa library. It was all working fine just a couple weeks ago meaning the entire codebase runs without error.

But today it seems like there's something wrong with librosa. When I try to do "import librosa" I get the following error:

OSError: cannot load library 'libsndfile.so': libsndfile.so: cannot open shared object file: No such file or directory

I don't know what this means or how to rectify it. I have tried updating both my pip and my wheel. I have also tried pip installing soundfile as well. But the error remains.

like image 712
PineNuts0 Avatar asked Jun 05 '26 23:06

PineNuts0


1 Answers

Please check the librosa dependencies

Need ffmpeg for decoding sound files

May need soundfile library

In my case there was no libsndfile1

I resolved using: sudo apt-get install libsndfile1 Blog to install libsndfile1

like image 157
Abhishek Trivedi Avatar answered Jun 08 '26 13:06

Abhishek Trivedi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!