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

5.0.0 & 5.0.1 do not install in python 3 on macOS (cannot load dynamic library) #2147

Closed
Tracked by #2081
gerph opened this issue Aug 23, 2023 · 4 comments
Closed
Tracked by #2081
Labels
bug build & packaging Build system and packaging related python bindings
Milestone

Comments

@gerph
Copy link

gerph commented Aug 23, 2023

Following on from #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)
>>> 
@Rot127
Copy link
Collaborator

Rot127 commented Aug 24, 2023

Have you tried pip install --pre --no-binary capstone capston (as suggested in #2066)?

Can't test it myself, don't run a Mac unfortunately :(

@XVilka XVilka mentioned this issue Aug 24, 2023
24 tasks
@kabeor
Copy link
Member

kabeor commented Aug 24, 2023

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.

@gerph
Copy link
Author

gerph commented Aug 24, 2023

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 :-)

@Rot127
Copy link
Collaborator

Rot127 commented Sep 10, 2024

Fixed in v5.0.3

@Rot127 Rot127 closed this as completed Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug build & packaging Build system and packaging related python bindings
Projects
None yet
Development

No branches or pull requests

3 participants