ha-rpi_gpio: Requirements for rpi_gpio not found: ['RPi.GPIO==0.7.1']

I have installation issues with 2022.7.0 of HA running in a docker container. I followed the recommendations given in the (identical but closed) issue #83, I tried to remove rpi_gpio from my config, uninstall integration, restart HA, install integration, restart HA, and everything is fine in the log. But as soon I add the rpi_gpio integration config in the yaml, I get the installation error in the log during the config check : Platform error switch.rpi_gpio - Requirements for rpi_gpio not found: ['RPi.GPIO==0.7.1'].

And more detail in the container’s log :

2022-07-07 11:59:56 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package RPi.GPIO==0.7.1: error: subprocess-exited-with-error
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-cpython-310
      creating build/lib.linux-armv7l-cpython-310/RPi
      copying RPi/__init__.py -> build/lib.linux-armv7l-cpython-310/RPi
      creating build/lib.linux-armv7l-cpython-310/RPi/GPIO
      copying RPi/GPIO/__init__.py -> build/lib.linux-armv7l-cpython-310/RPi/GPIO
      running build_ext
      building 'RPi._GPIO' extension
      creating build/temp.linux-armv7l-cpython-310
      creating build/temp.linux-armv7l-cpython-310/source
      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 RPi.GPIO
  error: subprocess-exited-with-error
  × Running setup.py install for RPi.GPIO did not run successfully.
  ╰─> [17 lines of output]
      running install
      /usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> RPi.GPIO
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

The YAML looks like this :

- platform: rpi_gpio
  switches:
    - port: 5
      name: "Volet Cuisine Montée"
      invert_logic: true
    - port: 6
      name: "Volet Cuisine Descente"
      invert_logic: true
    - port: 13
      name: "Volet Baie Sud-Est Montée"
      invert_logic: true
    - port: 16
      name: "Volet Baie Sud-Est Descente"
      invert_logic: true
    - port: 19
      name: "Volet Baie Sud-Ouest Montée"
      invert_logic: true
    - port: 20
      name: "Volet Baie Sud-Ouest Descente"
      invert_logic: true
    - port: 21
      name: "Volet Bureau Montée"
      invert_logic: true
    - port: 26
      name: "Volet Bureau Descente"
      invert_logic: true

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 26 (8 by maintainers)

Most upvoted comments

I think I understand the problem now, I was not putting attention that your docker installation might be different. You need to add an environment variable to the wheels repo This is how it looks like in Home Assistant OS: image

Something like -e WHEELS_LINKS='https://wheels.home-assistant.io/musllinux/' Or in compose:

  environment:
    - WHEELS_LINKS=[1](https://wheels.home-assistant.io/musllinux/)

I think I understand the problem now, I was not putting attention that your docker installation might be different. You need to add an environment variable to the wheels repo This is how it looks like in Home Assistant OS: image

Something like -e WHEELS_LINKS='https://wheels.home-assistant.io/musllinux/' Or in compose:

  environment:
    - WHEELS_LINKS=[1](https://wheels.home-assistant.io/musllinux/)

That definitely solved the issue. Updated to 2022.8.0 today without requiring to manually install the wheel package.

After adding the variable to the environment, I could restart the container without issue 😃 . So it seems to be fixed, I’ll wait for the next update to confirm. Thanks a lot.

Delete the Rpi GPIO configuration (configuration.yaml). Update Rpi GPIO version 2022.7.0. Restart HA. After reboot, insert Rpi Gpio configuration and restart HA again.

Already done, not working.

The above should work. Your system should be supported and the wheel should be downloaded from https://wheels.home-assistant.io/musllinux/RPi.GPIO-0.7.1-cp310-cp310-musllinux_1_2_armv7l.whl automatically on new install.

You can try:

  1. Repeat the suggestion above again. Maybe remove the rpi_gpio completely, restart HA, do fresh install from HACS and add the configuration back.
  2. Download the wheel from the link above and manually install it: pip install RPi.GPIO-0.7.1-cp310-cp310-musllinux_1_2_armv7l.whl

Thanks, I could fix the issue. Didn’t use the step 1 (I did it several times unsuccessfully), so I had the error at container boot and config check.

So I first connected to the container’s console as root, then I used the wget https://wheels.home-assistant.io/musllinux/RPi.GPIO-0.7.1-cp310-cp310-musllinux_1_2_armv7l.whl command to download the wheel. After that your step 2 worked to install the missing dependency, and I could then check the config successfully and restart Home Assistant without issue, now rpi_gpio works perfectly.

But I really don’t understand why the wheel installation could work with manual method and not when using HACS.