conorpp / btproxy

Man in the Middle analysis tool for Bluetooth.
GNU General Public License v3.0
509 stars 76 forks source link

undefined symbol: Py_InitModule #12

Open lefuturiste opened 5 years ago

lefuturiste commented 5 years ago

when running, whatever the case

Traceback (most recent call last):
  File "/usr/bin/btproxy", line 4, in <module>
    __import__('pkg_resources').run_script('btproxy==0.1', 'btproxy')
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 661, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1441, in run_script
    exec(code, namespace, namespace)
  File "/usr/lib/python3.7/site-packages/btproxy-0.1-py3.7-linux-x86_64.egg/EGG-INFO/scripts/btproxy", line 4, in <module>
    from libbtproxy.argparser import args,parser
  File "/usr/lib/python3.7/site-packages/btproxy-0.1-py3.7-linux-x86_64.egg/libbtproxy/__init__.py", line 3, in <module>
    import clone
ImportError: /usr/lib/python3.7/site-packages/btproxy-0.1-py3.7-linux-x86_64.egg/clone.cpython-37m-x86_64-linux-gnu.so: undefined symbol: Py_InitModule
tachwali commented 5 years ago

it seems this is a python 3 support issue. I encounter this problem with cosim flow (python driver) but not with simulation

HengLou commented 3 years ago

I encountered this issue with python 3.8. Anyone have a solution to build btproxy?

Furuidemu commented 2 years ago

I encountered this issue with python 3.8. Anyone have a solution to build btproxy?

Replacing https://github.com/conorpp/btproxy/blob/master/lib/btproxy_clone.c#L118 with #if PY_MAJOR_VERSION >= 3 at least makes btproxy run on my machine

If you don't want to edit the c file, you can also define a macro in btproxy/setup.py

git clone https://github.com/conorpp/btproxy
sed -i "12a\ \ \ \ define_macros=[('PYTHON34', 'true')]," btproxy/setup.py
cd btproxy 
sudo python3 setup.py install