capstone
capstone copied to clipboard
5.0.0 & 5.0.1 do not install in python 3 on macOS (cannot load dynamic library)
Following on from https://github.com/capstone-engine/capstone/issues/2145...
@gerph I know you are aware of it, but as a general note: Because Python2 is EOL we removed the CI code for it as well. So there is no guarantee that it will work in the future.
So I tried installing 5.0.0 and 5.0.1 on macOS 10.14.6 (which is presumably supported by the universal wheel) with Python 3.9...
charles@laputa ~/projects/RO/pyromaniac (protect-daheap-free-blocks↑2)> pip3 install capstone==5.0.1
Collecting capstone==5.0.1
Using cached capstone-5.0.1-py3-none-macosx_10_9_universal2.whl (2.4 MB)
Installing collected packages: capstone
Attempting uninstall: capstone
Found existing installation: capstone 5.0.0
Uninstalling capstone-5.0.0:
Successfully uninstalled capstone-5.0.0
Successfully installed capstone-5.0.1
WARNING: You are using pip version 20.3.3; however, version 23.2.1 is available.
You should consider upgrading via the '/usr/local/opt/[email protected]/bin/python3.9 -m pip install --upgrade pip' command.
charles@laputa ~/projects/RO/pyromaniac (protect-daheap-free-blocks↑2)> python3
Python 3.9.1 (default, Jan 8 2021, 17:15:36)
[Clang 11.0.0 (clang-1100.0.33.17)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import capstone
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/capstone/__init__.py", line 425, in <module>
_cs = _load_lib(_path)
File "/usr/local/lib/python3.9/site-packages/capstone/__init__.py", line 398, in _load_lib
return ctypes.cdll.LoadLibrary(lib_file)
File "/usr/local/Cellar/[email protected]/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 452, in LoadLibrary
return self._dlltype(name)
File "/usr/local/Cellar/[email protected]/3.9.1_6/Frameworks/Python.framework/Versions/3.9/lib/python3.9/ctypes/__init__.py", line 374, in __init__
self._handle = _dlopen(self._name, mode)
OSError: dlopen(/usr/local/lib/python3.9/site-packages/capstone/lib/libcapstone.dylib, 6): no suitable image found. Did find:
/usr/local/lib/python3.9/site-packages/capstone/lib/libcapstone.dylib: cannot load 'libcapstone.dylib' (load command 0x80000034 is unknown)
/usr/local/lib/python3.9/site-packages/capstone/lib/libcapstone.dylib: cannot load 'libcapstone.dylib' (load command 0x80000034 is unknown)
>>>
Have you tried pip install --pre --no-binary capstone capston
(as suggested in https://github.com/capstone-engine/capstone/issues/2066)?
Can't test it myself, don't run a Mac unfortunately :(
Just got a Apple Silicon Macbook for fixing this. This issue will be fixed in next release.
And for now, plz using pip install --pre --no-binary capstone capstone
.
Ah yes, I'm running on an old intel macbook - sorry, I keep forgetting that it's important to mention the architecture whilst Apple have two different systems.
And to confirm - yes, if I use that command line to install with Python 3, all is well. Thank you :-)