Failed to install on macOS 12.4 with M1 chip
Closed this issue · 7 comments
Same issue with #13 but the error seems to be coming from a module and not clang itself.
Using Python 3.10 and PIP 22.0.4.
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [28 lines of output]
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "/Users/soraboken/Downloads/just_playback-0.1.6/setup.py", line 7, in <module>
setup(
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
return distutils.core.setup(**attrs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 455, in __init__
_Distribution.__init__(self, {
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/distutils/dist.py", line 292, in __init__
self.finalize_options()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 807, in finalize_options
ep(self)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/setuptools/dist.py", line 814, in _finalize_setup_keywords
ep.load()(self, ep.name, value)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 219, in cffi_modules
add_cffi_module(dist, cffi_module)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 49, in add_cffi_module
execfile(build_file_name, mod_vars)
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cffi/setuptools_ext.py", line 25, in execfile
exec(code, glob, glob)
File "build_ffi_module.py", line 5, in <module>
ffibuilder = FFI()
File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/cffi/api.py", line 48, in __init__
import _cffi_backend as backend
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_cffi_backend.cpython-310-darwin.so, 0x0002): tried: '/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_cffi_backend.cpython-310-darwin.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))
Hi @skyventuree
What version of cffi are you using ?? If it's <1.15.0 then try installing this version. I believe it's the first providing wheels for arm64.
cffi is 1.15.0.
What is the output of file /Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_cffi_backend.cpython-310-darwin.so
??
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/_cffi_backend.cpython-310-darwin.so: Mach-O 64-bit bundle arm64
I find the have 'arm64', need 'x86_64'
error on an ARM chip weird, probably because I'm not too familiar with M1 Macs. Are you doing x86 emulation in your shell ?? Say with arch -x86_64 /bin/bash
?? What is the output of uname -m
??
I tried install just-playback on both native and x86 emulation and it yields the same error.
The result of uname -m
vary whether if I have Rosetta 2 enabled or not.
I found the solution:
What I did is that I tried re-installing cffi on Terminal with Rosetta 2 enabled and now the cffi should be in x86_64 as expected.
Now I just remove the 2 parameters in the build ffi file and it successfully installed.