Skip to content

Make python and apk run correctly #1078

@bilogic

Description

@bilogic

A - Advanced Terminal commands

apk add bluez dbus
python3 -m venv venv
source venv/bin/activate
pip install bleak
python bleak-example.py

B - VSCode commands

apt install bluez dbus
python3 -m venv venv
source venv/bin/activate
pip install bleak
python bleak-example.py
Traceback (most recent call last):
  File "/config/custom_components/ble-integration/bleak-example.py", line 21, in <module>
    asyncio.run(main())
    ~~~~~~~~~~~^^^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 195, in run
    return runner.run(main)
           ~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/usr/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
    return future.result()
           ~~~~~~~~~~~~~^^
  File "/config/custom_components/ble-integration/bleak-example.py", line 16, in main
    await scanner.start()
  File "/config/custom_components/ble-integration/venv/lib/python3.13/site-packages/bleak/__init__.py", line 179, in start
    await self._backend.start()
  File "/config/custom_components/ble-integration/venv/lib/python3.13/site-packages/bleak/backends/bluezdbus/scanner.py", line 120, in start
    manager = await get_global_bluez_manager()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ble-integration/venv/lib/python3.13/site-packages/bleak/backends/bluezdbus/manager.py", line 1163, in get_global_bluez_manager
    await instance.async_init()
  File "/config/custom_components/ble-integration/venv/lib/python3.13/site-packages/bleak/backends/bluezdbus/manager.py", line 258, in async_init
    bus = MessageBus(bus_type=BusType.SYSTEM, auth=get_dbus_authenticator())
  File "/config/custom_components/ble-integration/venv/lib/python3.13/site-packages/dbus_fast/aio/message_bus.py", line 209, in __init__
    super().__init__(bus_address, bus_type, ProxyObject, negotiate_unix_fd)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src/dbus_fast/message_bus.py", line 176, in dbus_fast.message_bus.BaseMessageBus.__init__
  File "src/dbus_fast/message_bus.py", line 747, in dbus_fast.message_bus.BaseMessageBus._setup_socket
  File "src/dbus_fast/message_bus.py", line 709, in dbus_fast.message_bus.BaseMessageBus._setup_socket
FileNotFoundError: [Errno 2] No such file or directory
  1. Using Advanced Terminal at https://github.com/hassio-addons/addon-ssh, I'm able to run Commands A with no issues
  2. Using VSCode's CLI, I had to run Commands B, and in the end, it gave me exceptions

Possible to make VSCode use the same base image (ARG BUILD_FROM=ghcr.io/hassio-addons/base:19.0.0) as Advanced Terminal?

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThere has not been activity on this issue or PR for quite some time.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions