bastibe / python-soundfile

SoundFile is an audio library based on libsndfile, CFFI, and NumPy
BSD 3-Clause "New" or "Revised" License
701 stars 108 forks source link

module 'soundfile' has no attribute 'SoundFileRuntimeError' #414

Open abavisani opened 11 months ago

abavisani commented 11 months ago

I am receiving the above error while using librosa.load(). Any thought on what's the root of the issue?

bastibe commented 11 months ago

The source code of soundfile clearly does have the SoundFileRuntimeError defined. You could check what version of soundfile you received.

notadoktor commented 11 months ago

I just ran across this error myself. I mistakenly installed pysoundfile rather than soundfile. The old package name is at version 0.9.0 and SoundFileRuntimeError was added in 0.11.

Related: https://github.com/librosa/librosa/issues/1624

bastibe commented 11 months ago

It's a tough call. I could replace pysoundcard with an incompatible stub to get people to update to soundcard. But I hate breaking other peoples' code for no reason.

notadoktor commented 11 months ago

Maybe put in a deprecation warning?

bastibe commented 11 months ago

Deprecation warnings are hidden by default, which is a bit of a shame really. Or we just wait it out. Usage of pysoundfile has been slowly declining, so it's not a huge problem.

boeddeker commented 1 month ago

I could replace pysoundcard with an incompatible stub to get people to update to soundcard.

How about updating pysoundfile to be an empty package that depends on soundfile? If people need the old package, they could pin the version number, otherwise, they would get the recent version.

The reason, why I am suggesting this is: When you install first soundfile and then pysoundfile, pip says you have soundfile installed, but the source code is from pysoundfile (i.e., the old code). The first time, when I hit this issue, it took me some time to figure out, that the source code from soundfile was replaced by pysoundfile.