capstone icon indicating copy to clipboard operation
capstone copied to clipboard

ImportError: ERROR: fail to load the dynamic library.

Open faraanh opened this issue 8 years ago • 5 comments

Hi, I setup cuckoo in my windows, but I have some issuse below, Can you help me? C:\Users\faraa>cuckoo init No handlers could be found for logger "cuckoo.compat.magic" Traceback (most recent call last): File "c:\python27\lib\runpy.py", line 162, in run_module_as_main "main", fname, loader, pkg_name) File "c:\python27\lib\runpy.py", line 72, in run_code exec code in run_globals File "C:\Python27\Scripts\cuckoo.exe_main.py", line 5, in File "c:\python27\lib\site-packages\cuckoo_init.py", line 6, in from cuckoo import ( File "c:\python27\lib\site-packages\cuckoo\auxiliary_init_.py", line 6, in from cuckoo.core.plugins import enumerate_plugins File "c:\python27\lib\site-packages\cuckoo\core\plugins.py", line 20, in from cuckoo.core.extract import ExtractManager File "c:\python27\lib\site-packages\cuckoo\core\extract.py", line 5, in import egghatch File "c:\python27\lib\site-packages\egghatch_init_.py", line 5, in from egghatch.main import parse, as_text File "c:\python27\lib\site-packages\egghatch\main.py", line 8, in from egghatch.shellcode import Shellcode File "c:\python27\lib\site-packages\egghatch\shellcode.py", line 5, in import capstone File "c:\python27\lib\site-packages\capstone_init_.py", line 230, in raise ImportError("ERROR: fail to load the dynamic library.") ImportError: ERROR: fail to load the dynamic library.

faraanh avatar Dec 24 '17 03:12 faraanh

@faraanh I am having the same problem! Any luck fixing it?

georgew1000 avatar Mar 02 '18 18:03 georgew1000

Seems to be a problem with loading capstone, from the last lines in your log (and mine). Pip installing capstone on Windows is tricky as it wants to build (cmake or nmake) locally. This package says it's a prebuilt capstone for Windows: https://pypi.python.org/pypi/capstone-windows , but installing that didn't immediately resolve the issue for me. I ended up uninstalling (pip), removing the capstone folder (explorer) and then pip installing capstone-windows which cleared the error.

This manifested after a reinstallation of Python 2.7 (removed manual install, then installed with Choco) .

hth, adric

adricnet avatar Apr 06 '18 21:04 adricnet

This error is weirding me out! :hear_no_evil:

I successfully installed Capstone via pip3 install capstone, and it pretty much runs fine. But then I decided I wanted to try the Python tests in the ./capstone/bindings/python.

Only to be greeted with:

#  python3 test_arm.py
Traceback (most recent call last):
  File "test_arm.py", line 5, in <module>
    from capstone import *
  File "/home/xxx/capstone/bindings/python/capstone/__init__.py", line 315, in <module>
    raise ImportError("ERROR: fail to load the dynamic library.")
ImportError: ERROR: fail to load the dynamic library.

Which library is it talking about? Looks like I'm missing something...

E3V3A avatar Oct 20 '18 18:10 E3V3A

This issue has been resolved by following this updated installation procedure, when using Cygwin and Python3. A new Wiki page has been added, describing the procedure.

E3V3A avatar Oct 21 '18 15:10 E3V3A

For anyone else having this problem: for me it didn't find the dll because it got installed into the wrong folder. It should've been installed into ...\Users\[user]\AppData\Local\Programs\Python\Python39\Lib\site-packages\capstone\capstone.dll however for some reason it got installed to ...\Users\[user]\AppData\Local\Programs\Python\Python39\Lib\site-packages\users\[user]\appdata\local\programs\python\python39\Lib\site-packages\capstone. Not joking.

ktmriki avatar Sep 15 '22 06:09 ktmriki