Librosa and ModuleNotFoundError: No module named 'sunau'

I keep getting this runtime error message “ModuleNotFoundError: No module named ‘sunau’” whenever I import librosa in my code, and try to use it for audio processing.

I used the AI Assistant to help me figure out what was going on and it turns out that there is no solution there, despite all of what AI Assistant had me do. I even reinstalled Python at one point.

The last thing I tried was to copy and paste my Python script into a working project I did earlier, and that didn’t work either.

So if anyone has any suggestions for how I can fix these issues or find alternative solutions, I’m at the end here. I’m open to anything really.

Stefaan Meeuws

The sunau module was removed from Python 3.13. librosa currently only supports Python up to 3.12. The solution to your problem is to downgrade your Python version.

1 Like

You can get sunau from PyPI, it’ll be the same version that was previously available in the standard library. But there’s no guarantee that librosa will work on Python 3.13 as it doesn’t announce support for anything past 3.12.

AI assistants aren’t very good at actually knowing facts, nor doing research. It’s completely wrong here, and reinstalling Python was a waste of your time.

2 Likes