Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSError when importing opensmile on MacBook M1 laptop #64

Open
Omer80 opened this issue Nov 23, 2022 · 13 comments
Open

OSError when importing opensmile on MacBook M1 laptop #64

Omer80 opened this issue Nov 23, 2022 · 13 comments

Comments

@Omer80
Copy link

Omer80 commented Nov 23, 2022

I installed opensmile in a miniforge3 environment, but when I try to import it I get the following error:
OSError: dlopen(/Users/omertzuk/miniforge3/envs/tf/lib/python3.8/site-packages/audresample/core/bin/libaudresample.dylib, 0x0006): tried: '/Users/omertzuk/miniforge3/envs/tf/lib/python3.8/site-packages/audresample/core/bin/libaudresample.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e'))

Is there a way to make it work on x86_64 architecture?

@hagenw
Copy link
Member

hagenw commented Nov 23, 2022

We currently do not support M1, see also audeering/audresample#21.

But we are planing to add it in the near future.

@hagenw
Copy link
Member

hagenw commented Jan 27, 2023

We have now made a new release of audresample supporting MacOS M1 architecture.
Please update audresample with:

$ pip install --upgrade audresample

and try again.

@owuQQQ
Copy link

owuQQQ commented Feb 14, 2023

I tried to upgrade the audresample, but it seems not to work.

I got the following errors:

dlopen(/Users/yuwang/miniforge3/lib/python3.10/site-packages/audresample/core/bin/macos-intel/libaudresample.dylib, 0x0006): tried: '/Users/yuwang/miniforge3/lib/python3.10/site-packages/audresample/core/bin/macos-intel/libaudresample.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/yuwang/miniforge3/lib/python3.10/site-packages/audresample/core/bin/macos-intel/libaudresample.dylib' (no such file), '/Users/yuwang/miniforge3/lib/python3.10/site-packages/audresample/core/bin/macos-intel/libaudresample.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

@hagenw
Copy link
Member

hagenw commented Feb 14, 2023

Thanks for reporting again.

What seems strange to me is that it tries to load macos-intel/libaudresample.dylib, whereas it should load macos-m1/libaudresample.dylib.

Could you post the output of the following two commands:

platform.system()
platform.processor()

@hendryman
Copy link

I have exactly the same problem except "intel" does not show up in my error:

OSError: dlopen(/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib, 0x0006): tried: '/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib' (no such file), '/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

>>> platform.system()
'Darwin'
>>> platform.processor()
'arm'
>>>

@hagenw
Copy link
Member

hagenw commented Feb 15, 2023

I have exactly the same problem except "intel" does not show up in my error:

OSError: dlopen(/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib, 0x0006): tried: '/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib' (no such file), '/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

>>> platform.system()
'Darwin'
>>> platform.processor()
'arm'
>>>

We added support for MacOS M1 only with version 1.2.0 of audresample, please run

$ pip install --upgrade audresample

and try again.

We are catching the case of 'Darwin' and 'arm' at https://github.com/audeering/audresample/blob/3cd2bff35a2818698316c466a8d84dc6816014c3/audresample/core/lib.py#L21-L26. In a CI job on our internal M1 runner it does work.

@hendryman
Copy link

pip install --upgrade audresample                                      ✔
Requirement already satisfied: audresample in /opt/homebrew/lib/python3.10/site-packages (1.2.1)

Any idea where else the source of the problem could be?

@hendryman
Copy link

hendryman commented Mar 5, 2023

I tried this:

pip install --upgrade audresample --force-reinstall --no-cache-dir

Which gives me:

Downloading audresample-1.2.1-py3-none-any.whl (494 kB)
(...)
Successfully installed audresample-1.2.1 (...)

But it did not help either...

Here's the full error message I get on my MacBook Pro M1 Max:

python3 /Users/manuel/opensmile-python/tests/test_smile.py 

Traceback (most recent call last):
  File "/Users/manuel/Dropbox/GitHub/repos/feelingmachine/develop/emo_detect/opensmile-python/tests/test_smile.py", line 11, in <module>
    import opensmile
  File "/opt/homebrew/lib/python3.10/site-packages/opensmile/__init__.py", line 6, in <module>
    from opensmile.core.smile import (
  File "/opt/homebrew/lib/python3.10/site-packages/opensmile/core/smile.py", line 13, in <module>
    from opensmile.core.SMILEapi import (
  File "/opt/homebrew/lib/python3.10/site-packages/opensmile/core/SMILEapi.py", line 23, in <module>
    smileapi = cdll.LoadLibrary(smileapi_path)
  File "/opt/homebrew/Cellar/python@3.10/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py", line 452, in LoadLibrary
    return self._dlltype(name)
  File "/opt/homebrew/Cellar/python@3.10/3.10.10/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: dlopen(/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib, 0x0006): tried: '/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib' (no such file), '/opt/homebrew/lib/python3.10/site-packages/opensmile/core/bin/osx/libSMILEapi.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

@hagenw
Copy link
Member

hagenw commented Mar 13, 2023

You are right, we need to provide openSMILE binaries for M1 as well, audresample is of cause not enough.
So at the moment we don't support M1 with the Python package of openSMILE and will need to add it.

@hendryman
Copy link

Just checking if there's hope here : ) Would love to implement openSMILE for this but can't because I'm stuck on a M1 laptop...

@lrjam
Copy link

lrjam commented Jun 23, 2023

Anyone got any updates on this? Praying for a fix. TIA!

@hagenw
Copy link
Member

hagenw commented Jun 23, 2023

There are two steps this:

  • provide M1 support for the used audresample lib, which was done with version 1.3.1
  • compile opensmile binaries for M1 and include in this repo

Both steps require that we use internal CI runners to build the required binaries. For opensmile this is slightly more complicated and requires certain developers to have time to work on this, which means I cannot directly say when this will be done, but my hope would be that it is solved in the next 3 months.

@hagenw
Copy link
Member

hagenw commented Oct 19, 2023

With release 2.5.0 we have now added support for M1. Could you please update your installation and try again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants