HA 0.115.1 Problem with instalation of bluepy

Hi, I’ve upgraded my HA Core to 0.115.1 and I have problem with integration with my bluetooth device (EQ3 termostats). I cannot instal bluepy library.

Here is my log:

Building wheels for collected packages: bluepy
  Running setup.py bdist_wheel for bluepy ... error
  Complete output from command /srv/homeassistant/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5h09mtw8/bluepy/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-knketgmj --python-tag cp37:
  running bdist_wheel
  running build
  running build_py
  Working dir is /tmp/pip-install-5h09mtw8/bluepy
  execute make -C ./bluepy clean
  execute make -C bluepy -j1
  Failed to compile bluepy-helper. Exiting install.
  Command was 'make -C bluepy -j1' in /tmp/pip-install-5h09mtw8/bluepy
  Return code was 2
  Output was:
  b"make: Entering directory '/tmp/pip-install-5h09mtw8/bluepy/bluepy'\ntar xzf bluez-src.tgz\ntouch ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c\nPackage glib-2.0 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `glib-2.0.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'glib-2.0' found\nPackage glib-2.0 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `glib-2.0.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'glib-2.0' found\ncc -L. -g -Wall  -Os -DHAVE_CONFIG_H -I./bluez-5.47/attrib -I./bluez-5.47 -I./bluez-5.47/lib -I./bluez-5.47/src -I./bluez-5.47/gdbus -I./bluez-5.47/btio -I./bluez-5.47/sys  -o bluepy-helper bluepy-helper.c ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c \nbluepy-helper.c:33:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/attrib/att.c:33:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/attrib/gatt.c:32:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/attrib/gattrib.c:34:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/attrib/utils.c:30:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/btio/btio.c:37:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/src/log.c:38:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/src/shared/io-glib.c:30:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/src/shared/timeout-glib.c:22:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\nmake: *** [Makefile:30: bluepy-helper] Error 1\nmake: Leaving directory '/tmp/pip-install-5h09mtw8/bluepy/bluepy'\n"

  ----------------------------------------
  Failed building wheel for bluepy
  Running setup.py clean for bluepy
Failed to build bluepy
Installing collected packages: bluepy
  Running setup.py install for bluepy ... error
    Complete output from command /srv/homeassistant/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5h09mtw8/bluepy/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-sh93324l/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.7/bluepy:
    running install
    running build
    running build_py
    Working dir is /tmp/pip-install-5h09mtw8/bluepy
    execute make -C ./bluepy clean
    execute make -C bluepy -j1
    Failed to compile bluepy-helper. Exiting install.
    Command was 'make -C bluepy -j1' in /tmp/pip-install-5h09mtw8/bluepy
    Return code was 2
    Output was:
    b"make: Entering directory '/tmp/pip-install-5h09mtw8/bluepy/bluepy'\ntar xzf bluez-src.tgz\ntouch ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c\nPackage glib-2.0 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `glib-2.0.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'glib-2.0' found\nPackage glib-2.0 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `glib-2.0.pc'\nto the PKG_CONFIG_PATH environment variable\nNo package 'glib-2.0' found\ncc -L. -g -Wall  -Os -DHAVE_CONFIG_H -I./bluez-5.47/attrib -I./bluez-5.47 -I./bluez-5.47/lib -I./bluez-5.47/src -I./bluez-5.47/gdbus -I./bluez-5.47/btio -I./bluez-5.47/sys  -o bluepy-helper bluepy-helper.c ./bluez-5.47/lib/bluetooth.c ./bluez-5.47/lib/hci.c ./bluez-5.47/lib/sdp.c ./bluez-5.47/lib/uuid.c ./bluez-5.47/attrib/att.c ./bluez-5.47/attrib/gatt.c ./bluez-5.47/attrib/gattrib.c ./bluez-5.47/attrib/utils.c ./bluez-5.47/btio/btio.c ./bluez-5.47/src/log.c ./bluez-5.47/src/shared/mgmt.c ./bluez-5.47/src/shared/crypto.c ./bluez-5.47/src/shared/att.c ./bluez-5.47/src/shared/queue.c ./bluez-5.47/src/shared/util.c ./bluez-5.47/src/shared/io-glib.c ./bluez-5.47/src/shared/timeout-glib.c \nbluepy-helper.c:33:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/attrib/att.c:33:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/attrib/gatt.c:32:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/attrib/gattrib.c:34:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/attrib/utils.c:30:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/btio/btio.c:37:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/src/log.c:38:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/src/shared/io-glib.c:30:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\n./bluez-5.47/src/shared/timeout-glib.c:22:10: fatal error: glib.h: No such file or directory\n #include <glib.h>\n          ^~~~~~~~\ncompilation terminated.\nmake: *** [Makefile:30: bluepy-helper] Error 1\nmake: Leaving directory '/tmp/pip-install-5h09mtw8/bluepy/bluepy'\n"

    ----------------------------------------
Command "/srv/homeassistant/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-5h09mtw8/bluepy/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-sh93324l/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.7/bluepy" failed with error code 1 in /tmp/pip-install-5h09mtw8/bluepy/

Ok i solved this problem, I needed libglib2.0-dev lib

sudo apt-get install python3-pip libglib2.0-dev

1 Like

Hi, for guys running HomeAssistant container which is alpine based, I’ve successfully used

pip install --find-links $WHEELS_LINKS bluepy==1.3.0

seen on Bluepy fails to install on 0.94.1 · Issue #24441 · home-assistant/core · GitHub

3 Likes

I love you to death :heart:

Unfortunately this isn’t working as of 2023.5.3 on Home-Assistant-Core container. Has anyone been able to install bluepy?

/config/radon # pip install --find-links $WHEELS_LINKS bluepy==1.3.0
Looking in links: https://wheels.home-assistant.io/musllinux/
Collecting bluepy==1.3.0
  Using cached bluepy-1.3.0.tar.gz (217 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: bluepy
  Building wheel for bluepy (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      /usr/local/lib/python3.10/site-packages/setuptools/dist.py:788: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
        warnings.warn(
      running bdist_wheel
      running build
      running build_py
      Working dir is /tmp/pip-install-mmp2rki2/bluepy_22b1f8ad77d346a6912534a8802082df
      execute make -C ./bluepy clean
      error: [Errno 2] No such file or directory: 'make'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for bluepy
  Running setup.py clean for bluepy
Failed to build bluepy
ERROR: Could not build wheels for bluepy, which is required to install pyproject.toml-based projects
1 Like

you find a work around?