opensmile-python
opensmile-python copied to clipboard
OSError: /path_to_file/libaudresample.so: cannot open shared object file: No such file or directory
Hi,
my Issue may or may not be related to #26. When I try to import opensmile, right at the beginning of a python script, this error is thrown:
File "/media/pi1/E04C-9C99/Audio_Pi/SentenceDetect.py", line 11, in
OS: pi os 64 bit python version: 3.9.2 gcc( if needed, looking at issue #33): Debian 10.2.1-6
I already tried to set LD_LIBRARY_PATH, but this did not resolve the issue. Any help would be appreciated!
The place it tries to load libaudresample.so
looks strange to me. Did you install the package to a virtual environment?
For example, if I install audresample
to a virtual environment called test
with:
$ virtualenv --python=python3.9 test
$ source test/bin/activate
$ pip install audresample
I have the needed file and can also import audresample
:
$ ls test/lib/python3.9/site-packages/audresample/core/bin/linux/libaudresample.so
test/lib/python3.9/site-packages/audresample/core/bin/linux/libaudresample.so
$ python -c "import audresample; print(audresample.__version__)"
1.2.1
It seems like the following code we use inside audresample
is not sufficient to find the correct folder in your case:
https://github.com/audeering/audresample/blob/3cd2bff35a2818698316c466a8d84dc6816014c3/audresample/core/lib.py#L8-L14
Thank you for your answers. I tried it with and without venv, unfortunately the result is the same.
With ls ... my pi does find the .so file, but I am not even able to import audresample via the import-statement. The Error-Statement is basically the same as above.
Do you think there could be a workaround to find the correct folder?
Do you think there could be a workaround to find the correct folder?
Did you try to copy it manually to: /home/pi1/audresample/audresample/core/bin/linux/libaudresample.so
?
The file is already there, with permissions set to be executable and viewable by everyone.
The file is already there, with permissions set to be executable and viewable by everyone.
I see, then the problem is not that it cannot find the file, but rather that it cannot load the shared library.
Seems so, but I am somewhat lost why this could be the case.
OS: pi os 64 bit
It seems you are trying to run on a Raspberry Pi, correct?
I think it needs arm64
as architecture, but we support only x86-64
at the moment.
Yes, I am using a Raspberry Pi. Ah okay, so there is the problem. Do you have, by any chance, the plan to change that in the future?
Unfortunately, there is no arm64
runner available on Github (https://github.com/actions/runner-images/issues/5631).
There is the option to create a docker image for arm64
and use the docker image to build the binary, e.g. https://github.com/WebAssembly/wabt/pull/2184/files.
Or alternatively, we can use an internal runner to build the library.
So, yes, it should be possible to add support for it, and we will look into it.
Okay, thank you very much!
Could you maybe use platform
(import platform
) in Python and report the output of the following two commands from the PI:
-
platform.system()
-
platform.processor()
- Platform.system: Linux
- Platform.processor: Does not return anything, I will look into that.
With lscpu I get the following info: Architecture: aarch64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 1 Core(s) per socket: 4 Socket(s): 1 Vendor ID: ARM Model: 3 Model name: Cortex-A72 Stepping: r0p3
We build a binary on our RaspberryPi which has:
$ uname -m
armv7l
As a test you could copy it to the audresample/core/bin/linux/
and see if this help fixing the audresample
import error. opensmile
will then still not work for you as there we also need to update the binaries. But it would help if you could test if the new audresample
binary works on your RaspberryPi as well.
Thank you! Unfortunately I get a new error: wrong ELF class: ELFCLASS32
I guess, I made an error in providing you the ARMv7 binary as you have 64-bit. I attached here a ARMv8 binary that works with 64-bit, could you try again if this works?
Hi, sorry for the late answer! After inserting the file I get a new Error-Message:
OSError: /home/pi1/.local/lib/python3.9/site-packages/opensmile/core/bin/linux/libSMILEapi.so: cannot open shared object file: No such file or directory
Although the file exists in this place.
Thanks for the feedback. This means audresample
does now indeed work on your machine.
The error you are seeing now is due to missing support for ARMv8 in opensmile
. We will be able to add it when we have setup the needed scripts to solve https://github.com/audeering/opensmile-python/issues/78 during the next months.
With release 2.5.0 of opensmile
we should now support Raspberry PI. Could you maybe try to update your installation and try again.