RoBoLoG

[Python] pip install pybluez 실패 본문

Error Solution

[Python] pip install pybluez 실패

SKJun 2024. 7. 3. 18:00

오류 메시지

Collecting pybluez==0.20
  Using cached PyBluez-0.20.zip (104 kB)
Building wheels for collected packages: pybluez
  Building wheel for pybluez (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/local/rc_sw/common/vision_ws/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gfurmcdx/pybluez/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gfurmcdx/pybluez/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-c0deq7_b
       cwd: /tmp/pip-install-gfurmcdx/pybluez/
  Complete output (23 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  creating build/lib.linux-x86_64-3.8/bluetooth
  copying bluetooth/msbt.py -> build/lib.linux-x86_64-3.8/bluetooth
  copying bluetooth/btcommon.py -> build/lib.linux-x86_64-3.8/bluetooth
  copying bluetooth/__init__.py -> build/lib.linux-x86_64-3.8/bluetooth
  copying bluetooth/bluez.py -> build/lib.linux-x86_64-3.8/bluetooth
  copying bluetooth/osx.py -> build/lib.linux-x86_64-3.8/bluetooth
  copying bluetooth/widcomm.py -> build/lib.linux-x86_64-3.8/bluetooth
  running build_ext
  building 'bluetooth._bluetooth' extension
  creating build/temp.linux-x86_64-3.8
  creating build/temp.linux-x86_64-3.8/bluez
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./port3 -I/usr/local/rc_sw/common/vision_ws/include -I/usr/include/python3.8 -c bluez/btmodule.c -o build/temp.linux-x86_64-3.8/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 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pybluez
  Running setup.py clean for pybluez
Failed to build pybluez
Installing collected packages: pybluez
    Running setup.py install for pybluez ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/local/rc_sw/common/vision_ws/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gfurmcdx/pybluez/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gfurmcdx/pybluez/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ko2370l_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/rc_sw/common/vision_ws/include/site/python3.8/pybluez
         cwd: /tmp/pip-install-gfurmcdx/pybluez/
    Complete output (23 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.8
    creating build/lib.linux-x86_64-3.8/bluetooth
    copying bluetooth/msbt.py -> build/lib.linux-x86_64-3.8/bluetooth
    copying bluetooth/btcommon.py -> build/lib.linux-x86_64-3.8/bluetooth
    copying bluetooth/__init__.py -> build/lib.linux-x86_64-3.8/bluetooth
    copying bluetooth/bluez.py -> build/lib.linux-x86_64-3.8/bluetooth
    copying bluetooth/osx.py -> build/lib.linux-x86_64-3.8/bluetooth
    copying bluetooth/widcomm.py -> build/lib.linux-x86_64-3.8/bluetooth
    running build_ext
    building 'bluetooth._bluetooth' extension
    creating build/temp.linux-x86_64-3.8
    creating build/temp.linux-x86_64-3.8/bluez
    x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I./port3 -I/usr/local/rc_sw/common/vision_ws/include -I/usr/include/python3.8 -c bluez/btmodule.c -o build/temp.linux-x86_64-3.8/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 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/rc_sw/common/vision_ws/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-gfurmcdx/pybluez/setup.py'"'"'; __file__='"'"'/tmp/pip-install-gfurmcdx/pybluez/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ko2370l_/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/rc_sw/common/vision_ws/include/site/python3.8/pybluez Check the logs for full command output.

 

해결 방법

1. sudo apt-get install bluetooth libbluetooth-dev

2. pip install pybluez

728x90
반응형