pip install on apple silicon
I'm having trouble installing the Python interface on apple silicon and macosx -- pip does not find the correct wheel (it seems to find gmsh-4.8.4-py3-none-any.whl
, which is packaged with binaries for x86_64
):
❯ python -c "import gmsh; print(gmsh.__file__)"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Users/lukeo/.virtualenvs/gmshenv/lib/python3.9/site-packages/gmsh-4.8.4-MacOSX-sdk/lib/gmsh.py", line 40, in <module>
lib = CDLL(libpath)
File "/opt/homebrew/Cellar/python@3.9/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/Users/lukeo/.virtualenvs/gmshenv/lib/python3.9/site-packages/gmsh-4.8.4-MacOSX-sdk/lib/libgmsh.dylib, 0x0006): tried: '/Users/lukeo/.virtualenvs/gmshenv/lib/python3.9/site-packages/gmsh-4.8.4-MacOSX-sdk/lib/libgmsh.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/libgmsh.dylib' (no such file), '/usr/lib/libgmsh.dylib' (no such file)
Homebrew builds and installs correctly on arm ... the gui opens with gmsh
and if I run gmsh.py
directly from the homebrew directly for gmsh, it imports (and runs the gui just fine):
❯ python -c "import gmsh; print(gmsh.__file__)"
/opt/homebrew/Cellar/gmsh/4.9.2/lib/gmsh.py
Any tips on hacking pip to pick up the right binaries here? Is #1673 (closed) relevant?
Thanks!
Edited by Luke Olson