keystone-engine / keystone

Keystone assembler framework: Core (Arm, Arm64, Hexagon, Mips, PowerPC, Sparc, SystemZ & X86) + bindings
http://www.keystone-engine.org
GNU General Public License v2.0
2.31k stars 459 forks source link

Keystone Engine failed to locate libkeystone.so on Ubuntu 20.04 #460

Open peternguyen93 opened 4 years ago

peternguyen93 commented 4 years ago
Python 3.8.2 (default, Apr 27 2020, 15:53:34)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import keystone
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/keystone/__init__.py", line 4, in <module>
    from .keystone import Ks, ks_version, ks_arch_supported, version_bind, debug, KsError, __version__
  File "/usr/local/lib/python3.8/dist-packages/keystone/keystone.py", line 75, in <module>
    raise ImportError("ERROR: fail to load the dynamic library.")
ImportError: ERROR: fail to load the dynamic library.

The code only look for this directory: /usr/local/lib/python3.8/dist-packages/keystone/ but actually libkeystone.so located at /usr/local/lib/python3.8/dist-packages/usr/lib/python3/dist-packages/keystone/libkeystone.so

aquynh commented 4 years ago

does this still happen on the latest github code?

aquynh commented 4 years ago

we made some fixes on setup.py. you can reinstall Python binding with:

cd bindings/python
sudo make install3

you may want to try again now?