capstone icon indicating copy to clipboard operation
capstone copied to clipboard

python bindings depends on setuptools

Open trufae opened this issue 1 year ago • 4 comments

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

  • remove setuptools dependency
  • add setuptools as dependency

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.

trufae avatar Apr 26 '24 10:04 trufae

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

Rot127 avatar Apr 26 '24 11:04 Rot127

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 avatar Apr 26 '24 13:04 trufae

honored the issue template now

trufae avatar Apr 26 '24 13:04 trufae

This should be fixed with the lates Python update effort. Could you check again please?

Rot127 avatar Aug 15 '24 11:08 Rot127

Close this as completed with https://github.com/capstone-engine/capstone/pull/2396.

Rot127 avatar Sep 05 '24 08:09 Rot127