capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.19k stars 1.53k forks source link

python bindings depends on setuptools #2341

Open trufae opened 2 months ago

trufae commented 2 months ago

Work environment

Questions Answers
OS/arch/bits Debian arm 64
Architecture armv8
Source of Capstone pip
Version/git commit v5.0.1

Expected behavior

import capstone to work

Actual behavior

is not working

Steps to reproduce the behavior

pip install capstone results in "error unable to import pkg_resources". which is a module distributed with setuptools package. In order to fix that one of those two options must be picked

Additional Logs, screenshots, source code, configuration dump, ...

Drag and drop zip archives containing the Additional info here, don't use external services or link. Screenshots can be directly dropped here.

Rot127 commented 2 months ago

Please fill out the issue template. Also for the other issues. Which Capstone version are you talking about?

trufae commented 2 months ago
root@7a1a5043e38d:/# pip3 install capstone --break-system-packages
Collecting capstone
  Downloading capstone-5.0.1.tar.gz (2.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.9/2.9 MB 16.9 MB/s eta 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: capstone
  Building wheel for capstone (pyproject.toml) ... done
  Created wheel for capstone: filename=capstone-5.0.1-py3-none-manylinux1_aarch64.whl size=2828045 sha256=dfc2f39d0bd3d4b4336db71515cd6858227cbb7ce037923ab3180c435db30f49
  Stored in directory: /root/.cache/pip/wheels/5c/b1/25/2e6a9e9483eb8dbf0a852572ab53a8f4bb15e219bf356322fb
Successfully built capstone
Installing collected packages: capstone
Successfully installed capstone-5.0.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
root@7a1a5043e38d:/# python3
Python 3.11.9 (main, Apr 10 2024, 13:16:36) [GCC 13.2.0] on linux
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.11/dist-packages/capstone/__init__.py", line 380, in <module>
    import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
>>>
trufae commented 2 months ago

honored the issue template now