Here are a few of the most common problems that users encounter.
no attribute ‘display’¶
If you’re trying to run some example code, and encounter the following error message:
AttributeError: module 'librosa' has no attribute 'display'
it is because the
librosa.display submodule needs to be imported explicitly in librosa versions
earlier than 0.10.
This is because
matplotlib is an optional dependency for librosa, so we do not
assume that all users have it installed, or want plotting capability.
To fix the problem, add the line
to the beginning of your program.
NOTE: this is no longer necessary beginning with the 0.10 release, but it won’t hurt to include the explicit import statement.
If you’re loading an audio file, and see the following message:
UserWarning: PySoundFile failed. Trying audioread instead.
Do not worry. This is a warning, not an error. Odds are that your code is working just fine.
This warning is most often triggered by loading files encoded with mp3 format,
which are not supported by libsndfile prior to version 1.1.
When this situation is detected, librosa falls back to use the slower, but more
audioread-based file loader.