fO-000 / bluing

An intelligence gathering tool for hacking Bluetooth
GNU General Public License v3.0
714 stars 100 forks source link

Encountered error while trying to install package. ╰─> pybluez #20

Closed wiggigemc489 closed 2 years ago

wiggigemc489 commented 2 years ago

hey/ when i put pip3 install bluescan i get this output: Building wheels for collected packages: pybluez Building wheel for pybluez (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [38 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.9 creating build/lib.linux-x86_64-3.9/bluetooth copying bluetooth/btcommon.py -> build/lib.linux-x86_64-3.9/bluetooth copying bluetooth/init.py -> build/lib.linux-x86_64-3.9/bluetooth copying bluetooth/widcomm.py -> build/lib.linux-x86_64-3.9/bluetooth copying bluetooth/bluez.py -> build/lib.linux-x86_64-3.9/bluetooth copying bluetooth/ble.py -> build/lib.linux-x86_64-3.9/bluetooth copying bluetooth/msbt.py -> build/lib.linux-x86_64-3.9/bluetooth copying bluetooth/macos.py -> build/lib.linux-x86_64-3.9/bluetooth /usr/lib/python3/dist-packages/setuptools/lib2to3_ex.py:36: SetuptoolsDeprecationWarning: 2to3 support is deprecated. If the project still requires Python 2 support, please migrate to a single-codebase solution or employ an independent conversion process. warnings.warn( Fixing build/lib.linux-x86_64-3.9/bluetooth/btcommon.py build/lib.linux-x86_64-3.9/bluetooth/init.py build/lib.linux-x86_64-3.9/bluetooth/widcomm.py build/lib.linux-x86_64-3.9/bluetooth/bluez.py build/lib.linux-x86_64-3.9/bluetooth/ble.py build/lib.linux-x86_64-3.9/bluetooth/msbt.py build/lib.linux-x86_64-3.9/bluetooth/macos.py Skipping optional fixer: buffer Skipping optional fixer: idioms Skipping optional fixer: set_literal Skipping optional fixer: ws_comma Fixing build/lib.linux-x86_64-3.9/bluetooth/btcommon.py build/lib.linux-x86_64-3.9/bluetooth/init.py build/lib.linux-x86_64-3.9/bluetooth/widcomm.py build/lib.linux-x86_64-3.9/bluetooth/bluez.py build/lib.linux-x86_64-3.9/bluetooth/ble.py build/lib.linux-x86_64-3.9/bluetooth/msbt.py build/lib.linux-x86_64-3.9/bluetooth/macos.py Skipping optional fixer: buffer Skipping optional fixer: idioms Skipping optional fixer: set_literal Skipping optional fixer: ws_comma warning: build_py: byte-compiling is disabled, skipping.

  running build_ext
  building 'bluetooth._bluetooth' extension
  creating build/temp.linux-x86_64-3.9
  creating build/temp.linux-x86_64-3.9/bluez
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./port3 -I/usr/include/python3.9 -c bluez/btmodule.c -o build/temp.linux-x86_64-3.9/bluez/btmodule.o
  In file included from bluez/btmodule.c:20:
  bluez/btmodule.h:5:10: fatal error: bluetooth/bluetooth.h: No such file or directory
      5 | #include <bluetooth/bluetooth.h>
        |          ^~~~~~~~~~~~~~~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for pybluez Running setup.py clean for pybluez Failed to build pybluez

I tried installing python3- dev but already have it and still can't build pybluez. any ideas?

fO-000 commented 2 years ago

Have you installed the package mentioned in the README->requirements?

wiggigemc489 commented 2 years ago

hey, after i had a problem with my entire ubuntu i had to reinstall my whole system, after that i was able to install bluescan using the pip command and it worked. but when i run the bluescan i get this output: Traceback (most recent call last): File "/home/wiggige/.local/bin/bluescan", line 5, in from bluescan.main import main File "/home/wiggige/.local/lib/python3.8/site-packages/bluescan/main.py", line 19, in from .br_scan import BRScanner File "/home/wiggige/.local/lib/python3.8/site-packages/bluescan/br_scan.py", line 31, in from .common import bdaddr_to_company_name File "/home/wiggige/.local/lib/python3.8/site-packages/bluescan/common.py", line 28, in company_id = items[0].removesuffix(' (hex)') AttributeError: 'str' object has no attribute 'removesuffix' I'm fairly new to linux (currently studying but its hard for me to stay focus on my classes because they mostly teach the basics and not programming) would appreciate any kind of help, thanks.

fO-000 commented 2 years ago

I saw your comment in issue11.

The removesuffix is a python3.9 feature, which is not supported in python3.8. I think you installed bluescan using pip with python3.8. See pip -V. So even though you have python3.9 installed, bluescan still runs under python3.8.

There are two solutions: