Archived
Python import error on Macbook M1?
Hi,
I suffer an error when using python3 to import zeroc-ice on Macbook M1(Monterey 12.5.1):
ImportError: dlopen(/Users/username/Library/Python/3.8/lib/python/site-packages/IcePy.cpython-38-darwin.so, 0x0002):
tried: '/Users/username/Library/Python/3.8/lib/python/site-packages/IcePy.cpython-38-darwin.so'
(mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e)))
The zeroc-ice is installed by pip (python3 -m pip install zeroc-ice),
looks like it installed files for x86_64 architecture, but M1 cpu isn't, then import error,
Have anyone suffered this issue before?
May I consult how to solve it?
Thanks~
Comments
-
Hi,
How did you install Ice for Python?
0 -
For pip you can try setting
export ARCHFLAGS="-arch arm64"
and then re-install the package.0 -
Hi Jose,
Theexport ARCHFLAGS="-arch arm64
is working,Thank you very much~
0