addon-appdaemon icon indicating copy to clipboard operation
addon-appdaemon copied to clipboard

HASS Plugin Won't Load

Open fboundy opened this issue 8 months ago • 4 comments

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

fboundy avatar Jun 18 '24 11:06 fboundy