Thomas55555 / husqvarna_automower

Custom component for Home Assistant to monitor and control your Husqvarna Automower
https://github.com/Thomas55555/husqvarna_automower
MIT License
105 stars 28 forks source link

Missing dependency “Shapely>=1.8.2” since version 6.1 #519

Closed voldemarz closed 1 year ago

voldemarz commented 1 year ago

Prerequirements [x] I have connected my mower(s) to the Automower Connect App [x] I have connected my Husqvanra developers account to the Authentication API [x] I have connected my Husqvarna developers account to the Automower Connect API

Describe the bug Might not be a bug, just a side effect. Since version 6.1 this integration fails at startup in Home Assistant 2023.7.1 installed in a docker container on a Synology NAS (DSM 7.2-64570 Update 1). It appears HA is trying to compile and install dependencies and fails due to not having some tools like gcc. It seems quite tricky to add this to a docker image, so perhaps it is possible to get rid of this dependency if not essential.

Below excerpt from the log.

2023-07-25 01:40:22.200 ERROR (SyncWorker_2) [homeassistant.util.package] Unable to install package Shapely>=1.8.2: error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [300 lines of output]
      Looking in links: https://wheels.home-assistant.io/alpine-3.14/amd64/
      Collecting Cython~=0.29
        Using cached Cython-0.29.36-cp311-cp311-musllinux_1_1_x86_64.whl (2.0 MB)
      Collecting oldest-supported-numpy
        Using cached oldest_supported_numpy-2022.11.19-py3-none-any.whl (4.9 kB)
      Collecting setuptools>=61.0.0
        Using cached setuptools-68.0.0-py3-none-any.whl (804 kB)
      Collecting numpy==1.23.2 (from oldest-supported-numpy)
        Using cached numpy-1.23.2.tar.gz (10.7 MB)
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'done'
        Preparing metadata (pyproject.toml): started
        Preparing metadata (pyproject.toml): finished with status 'done'
      Building wheels for collected packages: numpy
        Building wheel for numpy (pyproject.toml): started
        Building wheel for numpy (pyproject.toml): finished with status 'error'
        error: subprocess-exited-with-error

        × Building wheel for numpy (pyproject.toml) did not run successfully.
        │ exit code: 1
        ╰─> [268 lines of output]
            setup.py:71: RuntimeWarning: NumPy 1.23.2 may not yet support Python 3.11.
              warnings.warn(
            Running from numpy source directory.
            setup.py:86: DeprecationWarning:

              `numpy.distutils` is deprecated since NumPy 1.23.0, as a result
              of the deprecation of `distutils` itself. It will be removed for
              Python >= 3.12. For older Python versions it will remain present.
              It is recommended to use `setuptools < 60.0` for those Python versions.
              For more details, see:
                https://numpy.org/devdocs/reference/distutils_status_migration.html

              import numpy.distutils.command.sdist
            Processing numpy/random/_bounded_integers.pxd.in

[omitted]

            WARN: Could not locate executable nagfor
            WARN: Could not locate executable frt
            WARN: don't know how to compile Fortran code on platform 'posix'

            [Errno 2] No such file or directory: 'gcc'

            Traceback (most recent call last):
              File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
                main()
              File "/usr/local/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
                json_out['return_val'] = hook(**hook_input['kwargs'])
                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

[omitted]

              File "/tmp/pip-install-0elajjrz/numpy_b54c90fc7bb74276a37a4e4eb5e4e27c/numpy/core/setup.py", line 758, in get_mathlib_info
                raise RuntimeError(
            RuntimeError: Broken toolchain: cannot link a simple C program.
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
        ERROR: Failed building wheel for numpy
      Failed to build numpy
      ERROR: Could not build wheels for numpy, which is required to install pyproject.toml-based projects

      [notice] A new release of pip is available: 23.1.2 -> 23.2.1
      [notice] To update, run: pip install --upgrade pip
      [end of output]

Expected behavior Integration initializes

Additional context Created support thread in the HA forum regarding this issue.

prairiesnpr commented 1 year ago

This looks to be a duplicate of #502, there are a couple solutions there that should work.

voldemarz commented 1 year ago

Yes. I had the same problem with WHEELS_LINKS environment variable. It was WHEELS_LINKS https://wheels.home-assistant.io/alpine-3.12/amd64/

Worked after changing to the same value as in https://github.com/home-assistant/docker/blob/master/Dockerfile WHEELS_LINKS https://wheels.home-assistant.io/musllinux/

In Synology DSM I updated it in the Container Manager. Selected HA in the Container section. Open Details via right mouse context menu. Then in the Settings tab is a list of environment variables.