core: Error when trying to enable Bluetooth Tracker

The problem

I tried enabled the Bluetooth Tracker integration, but I think it’s not working because I have this in my logs.

What version of Home Assistant Core has the issue?

core-2024.5.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Bluetooth Tracker

Link to integration documentation on our website

https://www.home-assistant.io/integrations/bluetooth_tracker

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Registrador: homeassistant.util.package
Fonte: util/package.py:123
Ocorreu pela primeira vez: 00:22:29 (3 ocorrências)
Último registro: 00:23:20

Unable to install package PyBluez==0.22: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [19 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-cpython-312 creating build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/ble.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/bluez.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/btcommon.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/msbt.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/osx.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/widcomm.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/__init__.py -> build/lib.linux-x86_64-cpython-312/bluetooth running build_ext building 'bluetooth._bluetooth' extension creating build/temp.linux-x86_64-cpython-312 creating build/temp.linux-x86_64-cpython-312/bluez gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I./port3 -I/usr/local/include/python3.12 -c bluez/btmodule.c -o build/temp.linux-x86_64-cpython-312/bluez/btmodule.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for PyBluez ERROR: Could not build wheels for PyBluez, which is required to install pyproject.toml-based projects

Registrador: homeassistant.config
Fonte: config.py:1326
Ocorreu pela primeira vez: 00:23:20 (1 ocorrências)
Último registro: 00:23:20

Platform error: device_tracker - Requirements for bluetooth_tracker not found: ['PyBluez==0.22'].

Additional information

My Bluetooth diagnostics: config_entry-bluetooth-8aaf76055c905202e0084b02ad040267.json

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (8 by maintainers)

Most upvoted comments

Same issue here,

Just included the bluetooth tracker in my config.yaml and when clicking on check configuration the following error appears:

Configuration warnings Platform error ‘device_tracker’ from integration ‘bluetooth_tracker’ - Requirements for bluetooth_tracker not found: [‘PyBluez==0.22’].

running HAOS 12.4 on a raspberry pi 4

Same issue with HAOS 13.0:

Logger: homeassistant.util.package
Source: util/package.py:123
First occurred: 11:26:44 AM (1 occurrences)
Last logged: 11:26:44 AM

Unable to install package PyBluez==0.22: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [19 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-cpython-312 creating build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/ble.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/bluez.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/btcommon.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/msbt.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/osx.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/widcomm.py -> build/lib.linux-x86_64-cpython-312/bluetooth copying bluetooth/__init__.py -> build/lib.linux-x86_64-cpython-312/bluetooth running build_ext building 'bluetooth._bluetooth' extension creating build/temp.linux-x86_64-cpython-312 creating build/temp.linux-x86_64-cpython-312/bluez gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I./port3 -I/usr/local/include/python3.12 -c bluez/btmodule.c -o build/temp.linux-x86_64-cpython-312/bluez/btmodule.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for PyBluez ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)

I really don’t understand how come no one else complained about this. Would I be the only person trying to use this integration? lol

It is a technical limitation, the integration uses an older Bluetooth implementation, that can’t be run on the set up used in our containers that the other installation methods use.

I expect this integration to be deprecated in the upcoming months, to be fully removed somewhere at the end of this year.

…/Frenck

I’m having the same issue. I read its due to an incompatibility with pyBluez and the newer python versions, but not really sure. Has anyone found a solid solution? Core - 2025.1.0 Supervisor - 2024.12.3 Operating System - Debian12 Frontend - 20250103.0

Got it, thank you.

This is unclear from the docs, and thus opened a pull request for that:

https://github.com/home-assistant/home-assistant.io/pull/38561

This integration is only available for Core installation types. Any other installation method, this integration cannot be used on.

…/Frenck

Can’t use bluetooth_tracker on HA OS intallation.

Configuration warnings
Platform error 'device_tracker' from integration 'bluetooth_tracker' - Requirements for bluetooth_tracker not found: ['PyBluez==0.22'].

System Info:

Core 2025.1.2 Supervisor 2025.02.1 Operating System 11.4 Frontend 20250109.0

Same issue here,

Just included the bluetooth tracker in my config.yaml.

device_tracker:
  - platform: bluetooth_tracker

Click on check configuration takes forever and the following error appears in the core log:

Unable to install package PyBluez==0.22: error: subprocess-exited-with-error × python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [19 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.linux-aarch64-cpython-312 creating build/lib.linux-aarch64-cpython-312/bluetooth copying bluetooth/ble.py -> build/lib.linux-aarch64-cpython-312/bluetooth copying bluetooth/bluez.py -> build/lib.linux-aarch64-cpython-312/bluetooth copying bluetooth/btcommon.py -> build/lib.linux-aarch64-cpython-312/bluetooth copying bluetooth/msbt.py -> build/lib.linux-aarch64-cpython-312/bluetooth copying bluetooth/osx.py -> build/lib.linux-aarch64-cpython-312/bluetooth copying bluetooth/widcomm.py -> build/lib.linux-aarch64-cpython-312/bluetooth copying bluetooth/__init__.py -> build/lib.linux-aarch64-cpython-312/bluetooth running build_ext building 'bluetooth._bluetooth' extension creating build/temp.linux-aarch64-cpython-312 creating build/temp.linux-aarch64-cpython-312/bluez gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I./port3 -I/usr/local/include/python3.12 -c bluez/btmodule.c -o build/temp.linux-aarch64-cpython-312/bluez/btmodule.o error: command 'gcc' failed: No such file or directory [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for PyBluez ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)

This is what I found about PyBluez on my home assistant:

/ $ grep PyBluez -R * 2> /dev/null
config/home-assistant.log:2024-08-30 07:11:30.127 ERROR (SyncWorker_25) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:11:39.761 ERROR (SyncWorker_23) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:12:03.906 ERROR (SyncWorker_25) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:12:12.485 ERROR (SyncWorker_23) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:12:13.828 ERROR (SyncWorker_42) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:12:39.284 ERROR (SyncWorker_25) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:12:45.966 ERROR (SyncWorker_23) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:12:46.998 ERROR (SyncWorker_42) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:13:10.084 ERROR (SyncWorker_42) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:14:22.749 ERROR (SyncWorker_21) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:14:46.112 ERROR (SyncWorker_21) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
config/home-assistant.log:2024-08-30 07:15:10.666 ERROR (SyncWorker_21) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
config/home-assistant.log:  ERROR: Failed building wheel for PyBluez
config/home-assistant.log:ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)
dev/mem:MESSAGE=2024-08-30 07:12:39.284 ERROR (SyncWorker_25) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
dev/mem:PyBluez.egg-info
dev/mem:MESSAGE=2024-08-30 07:12:39.284 ERROR (SyncWorker_25) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error

Interesting details:

  • Dune to this issue, my home assistant does not reboot anymore?!
  • cpu usage of home assistant core raised from 4% to 60% when I added the bluetooth tracker. It stayed high for 15 minutes.
  • When I remove the device_tracker: - platform: bluetooth_tracker I am able again to click on check configuration and reboot home assistant works again.

I have tried to solve the issues by installing py3-bluez package for alpine and then added the device_tracker in my config.yaml again, but that didn´t solve the issue:

apk add bluez
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/main/aarch64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.19/community/aarch64/APKINDEX.tar.gz
(1/11) Installing dbus-libs (1.14.10-r0)
(2/11) Installing libexpat (2.6.2-r0)
(3/11) Installing dbus (1.14.10-r0)
Executing dbus-1.14.10-r0.pre-install
Executing dbus-1.14.10-r0.post-install
(4/11) Installing dbus-daemon-launch-helper (1.14.10-r0)
(5/11) Installing libffi (3.4.4-r3)
(6/11) Installing libintl (0.22.3-r0)
(7/11) Installing libblkid (2.39.3-r0)
(8/11) Installing libmount (2.39.3-r0)
(9/11) Installing pcre2 (10.42-r2)
(10/11) Installing glib (2.78.6-r0)
(11/11) Installing bluez (5.70-r0)
Executing busybox-1.36.1-r19.trigger
Executing dbus-1.14.10-r0.trigger
Executing glib-2.78.6-r0.trigger
OK: 43 MiB in 57 packages

From the core log:

2024-08-31 09:41:07.981 ERROR (SyncWorker_0) [homeassistant.util.package] Unable to install package PyBluez==0.22: error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-312
      creating build/lib.linux-aarch64-cpython-312/bluetooth
      copying bluetooth/ble.py -> build/lib.linux-aarch64-cpython-312/bluetooth
      copying bluetooth/bluez.py -> build/lib.linux-aarch64-cpython-312/bluetooth
      copying bluetooth/btcommon.py -> build/lib.linux-aarch64-cpython-312/bluetooth
      copying bluetooth/msbt.py -> build/lib.linux-aarch64-cpython-312/bluetooth
      copying bluetooth/osx.py -> build/lib.linux-aarch64-cpython-312/bluetooth
      copying bluetooth/widcomm.py -> build/lib.linux-aarch64-cpython-312/bluetooth
      copying bluetooth/__init__.py -> build/lib.linux-aarch64-cpython-312/bluetooth
      running build_ext
      building 'bluetooth._bluetooth' extension
      creating build/temp.linux-aarch64-cpython-312
      creating build/temp.linux-aarch64-cpython-312/bluez
      gcc -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I./port3 -I/usr/local/include/python3.12 -c bluez/btmodule.c -o build/temp.linux-aarch64-cpython-312/bluez/btmodule.o
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for PyBluez
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (PyBluez)

Home assistant Yellow Core 2024.8.3 Supervisor 2024.08.0 Operating System 13.1 Frontend 20240809.0

How can I help to investigate to issue? What (log) files are needed to investigate?