hassio-addons / addon-appdaemon

AppDaemon4 - Home Assistant Community Add-ons
https://addons.community
MIT License
141 stars 45 forks source link

HASS Plugin Won't Load #345

Open fboundy opened 3 weeks ago

fboundy commented 3 weeks ago

Problem/Motivation

HASS plugin not loading with numpy 2.0.0

Expected behavior

AppDaemon should launch

Actual behavior

12:22:17 INFO AppDaemon: Loading Plugin HASS using class HassPlugin from module hassplugin
12:22:17 WARNING AppDaemon: error loading plugin: HASS - ignoring
12:22:17 WARNING AppDaemon: ------------------------------------------------------------
12:22:17 WARNING AppDaemon: Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/appdaemon/plugin_management.py", line 140, in __init__
    mod = __import__(full_module_name, globals(), locals(), [module_name], 0)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/appdaemon/plugins/hass/hassplugin.py", line 14, in <module>
    from deepdiff import DeepDiff
  File "/usr/lib/python3.11/site-packages/deepdiff/__init__.py", line 10, in <module>
    from .diff import DeepDiff
  File "/usr/lib/python3.11/site-packages/deepdiff/diff.py", line 18, in <module>
    from deepdiff.helper import (strings, bytes_type, numbers, uuids, times, ListItemRemovedOrAdded, notpresent,
  File "/usr/lib/python3.11/site-packages/deepdiff/helper.py", line 63, in <module>
    np_float_ = np.float_
                ^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.float_` was removed in the NumPy 2.0 release. Use `np.float64` instead.

12:22:17 WARNING AppDaemon: ------------------------------------------------------------
12:22:17 INFO AppDaemon: Loading Plugin MQTT using class MqttPlugin from module mqttplugin

Steps to reproduce

Add numpy (or pandas) as custom module in AppDaemon Addon config.

Use HASS plugin:

class TestApp(hass.HAss)

Proposed changes

The short term fix is to set numpy==1.26.4. It appears that the root cause is with the deepdiff module: https://github.com/seperman/deepdiff/issues/464 so ultimately AppDaemon or HA will need bumping to a fixed release of this module

ArdJonker commented 3 weeks ago

I have the same problem.

AppDaemon add-on log says:

s6-rc: info: service legacy-services: starting
[17:06:08] INFO: Starting AppDaemon...
s6-rc: info: service legacy-services successfully started
Failed to connect [Errno -2] Name does not resolve
Failed to connect [Errno -2] Name does not resolve
Failed to connect [Errno -2] Name does not resolve

My setup: VM on Linux Add-on version: 0.1.9 (i use a clone of AppDaemon 4.4.2) System: Home Assistant OS 12.3 (amd64 / qemux86-64) Home Assistant Core: 2024.5.5 (but also experienced the problem with 2024.6.3) Home Assistant Supervisor: 2024.06.0

mkagawa commented 2 weeks ago

same issue, HASS plugin cannot be loaded.

ast0815 commented 2 weeks ago

I got the same issue, as a python package I installed (seaborn) automatically chose the newest NumPy which is now 2.0.0. Adding a numpy<2 to the required python packages before seaborn fixed it for me.

koenieee commented 1 week ago

Same issue here, this also triggers entities not found in AppDeamon

Error was: not found in namespace default

Numpy set to fixed version fixes error