python-soundfile icon indicating copy to clipboard operation
python-soundfile copied to clipboard

Unable to import soundfile in AWS lambda

Open hsbaweja opened this issue 2 years ago • 4 comments
trafficstars

Trying to import soundfile inside AWS lambda results in the following error.

[ERROR] OSError: cannot load library 'libsndfile.so': /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /opt/python/_soundfile_data/libsndfile.so)

Since I can't install linux packages inside lambda, I used the whl to install soundfile so that it includes it's own libsndfile and modified LD_LIBRARY_PATH to point to this libsndfile.so file.

hsbaweja avatar Mar 07 '23 05:03 hsbaweja

The wheel is built and tagged for glibc >= 2.31 (because that's the oldest glibc available in Github's CI). You will need to supply your own libsndfile.

bastibe avatar Mar 07 '23 06:03 bastibe

I can see libm-2.26.so inside my lambda's /lib64/ folder, where can I find the compatible libsndfile.so for this? Is there an older commit that you recommend I can use to build the wheel?

hsbaweja avatar Mar 07 '23 16:03 hsbaweja

Sorry, this is not a tech support forum for AWS. See if your distro can install libsndfile, or compile it yourself.

bastibe avatar Mar 08 '23 07:03 bastibe

I just uploaded a wheel for glibc 2.17, which might solve your issue.

bastibe avatar Mar 24 '23 08:03 bastibe