Open dkm opened 3 hours ago
Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (bluetooth
) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)
bluetooth documentation bluetooth source (message by IssueLinks)
Its likely that you have an old verison of habluetooth
installed somewhre
Hmm, maybe, but I don't know how to really check that. Here's a small session where I check I don't have any existing module installed, and then create a new venv.
hass@hasspi:~$ python3.12 -c "import habluetooth"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'habluetooth'
hass@hasspi:~$ python3.12 -m venv new
hass@hasspi:~$ . ./new/bin/activate
(new) hass@hasspi:~$ python3.12 -c "import habluetooth"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'habluetooth'
(new) hass@hasspi:~$ pip install habluetooth
Collecting habluetooth
Using cached habluetooth-3.4.0-cp312-cp312-manylinux_2_38_aarch64.whl
....
Successfully installed PyRIC-0.1.6.3 aiooui-0.1.6 async-interrupt-1.2.0 bleak-0.22.2 bleak-retry-connector-3.5.0 bluetooth-adapters-0.19.4 bluetooth-auto-recovery-1.4.2 bluetooth-data-tools-1.20.0 btsocket-0.3.0 cffi-1.17.1 cryptography-43.0.1 dbus-fast-2.24.2 habluetooth-3.4.0 pycparser-2.22 uart-devices-0.1.0 usb-devices-0.4.5
(new) hass@hasspi:~$ pip show habluetooth
Name: habluetooth
Version: 3.4.0
Summary: High availability Bluetooth
Home-page: https://github.com/bluetooth-devices/habluetooth
Author: J. Nick Koston
Author-email: bluetooth@koston.org
License:
Location: /home/hass/new/lib/python3.12/site-packages
Requires: async-interrupt, bleak, bleak-retry-connector, bluetooth-adapters, bluetooth-auto-recovery, bluetooth-data-tools
Required-by:
(new) hass@hasspi:~$ python3.12 -c "import habluetooth"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/hass/new/lib/python3.12/site-packages/habluetooth/__init__.py", line 3, in <module>
from .advertisement_tracker import (
File "src/habluetooth/advertisement_tracker.py", line 1, in init habluetooth.advertisement_tracker
AttributeError: module 'habluetooth.models' has no attribute '__pyx_capi__'
Maybe I should report it on their github project instead. I only realize now that habluetooth
is not hosted in home-assistant
.
3.3.2 doesn't have this behavior, but I'm not sure I can force this version...
Yes, installing 3.3.2 doesn't help, hass
seems to be auto-updating the module to 3.4.0.
(venv) hass@hasspi:~/hass/venv$ pip show habluetooth
Name: habluetooth
Version: 3.3.2
Summary: High availability Bluetooth
Home-page: https://github.com/bluetooth-devices/habluetooth
Author: J. Nick Koston
Author-email: bluetooth@koston.org
License:
Location: /home/hass/hass/venv/lib/python3.12/site-packages
Requires: async-interrupt, bleak, bleak-retry-connector, bluetooth-adapters, bluetooth-auto-recovery, bluetooth-data-tools
Required-by: home-assistant-bluetooth
(venv) hass@hasspi:~/hass/venv$ hass
...
KeyboardInterrupt:
^C
(venv) hass@hasspi:~/hass/venv$ pip show habluetooth
Name: habluetooth
Version: 3.4.0
Summary: High availability Bluetooth
Home-page: https://github.com/bluetooth-devices/habluetooth
Author: J. Nick Koston
Author-email: bluetooth@koston.org
License:
Location: /home/hass/hass/venv/lib/python3.12/site-packages
Requires: async-interrupt, bleak, bleak-retry-connector, bluetooth-adapters, bluetooth-auto-recovery, bluetooth-data-tools
Required-by: home-assistant-bluetooth
Which cython version are you using to do the build?
Are you sure you don't have multiple copies of the habluetooth.models
shared object on your system, and its loading the wrong one?
AttributeError: module 'habluetooth.models' has no attribute '__pyx_capi__' seems to indicate you have mismatched versions
The problem
I'm installing homeassistant via a simple python venv (I have very limited usage of HA). The installation from a few months back was working correctly, but after a recent update (and then from scratch), the bluetooth integration can't be loaded.
What version of Home Assistant Core has the issue?
core-2024.9.2
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant Core
Integration causing the issue
bluetooth
Link to integration documentation on our website
https://www.home-assistant.io/integrations/bluetooth/
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?