pyscript icon indicating copy to clipboard operation
pyscript copied to clipboard

Cannot install from HACS on latest version of Home Assistant / HassOS

Open GraysonCAdams opened this issue 5 months ago • 9 comments

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 749, in __async_setup_with_context
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/pyscript/__init__.py", line 375, in async_setup_entry
    await watchdog_start(hass, pyscript_folder, reload_scripts_handler)
  File "/config/custom_components/pyscript/__init__.py", line 150, in watchdog_start
    class WatchDogHandler(FileSystemEventHandler):
    ...<46 lines>...
            self.process(event)
  File "/config/custom_components/pyscript/__init__.py", line 154, in WatchDogHandler
    self, watchdog_q: asyncio.Queue, observer: watchdog.observers.ObserverType, path: str
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'watchdog.observers' has no attribute 'ObserverType'

Looks like an import issue with Watchdog? @craigbarratt Have you seen this before?

GraysonCAdams avatar Jul 22 '25 20:07 GraysonCAdams

Having this issue as well on 2025.7.3. Was working well on 2025.7.1 or 2025.7.2 (Not sure from which one I just upgraded)

robin-thoni avatar Jul 27 '25 09:07 robin-thoni

The latest HA release seems to have downgraded from watchdog==6.0.0 to watchdog==1.0.1:

Image

https://github.com/gorakhargosh/watchdog/blob/v1.0.1/src/watchdog/observers/init.py:

Image

Even though the requirements_all.txt file has not changed: https://github.com/home-assistant/core/blob/2025.7.3/requirements_all.txt#L3078

robin-thoni avatar Jul 27 '25 09:07 robin-thoni

Also confirmed by pip freeze:

Image

That's an HA side issue. Not related to pyscript.

robin-thoni avatar Jul 27 '25 09:07 robin-thoni

Just opened an issue on the HA core side: https://github.com/home-assistant/core/issues/149513

robin-thoni avatar Jul 27 '25 09:07 robin-thoni

@GraysonCAdams Are you using the SpotifyPlus integration, by any chance? Try disabling it restart HA. The problem comes from this dependency.

robin-thoni avatar Jul 27 '25 09:07 robin-thoni

Issue on SpotifyPlus side: https://github.com/thlucas1/homeassistantcomponent_spotifyplus/issues/142

robin-thoni avatar Jul 27 '25 09:07 robin-thoni

@robin-thoni @GraysonCAdams I just updated SpotifyPlus integration to fix the watchdog==6.0.0 requirement.

The underlying smartInspectPython library was causing the issue, which still had a reference to watchdog==1.0.1. I also own that library, so was able to update it to use watchdog>=6.0.0 to match the Home Assistant requirement. This should fix any issue related to SpotifyPlus / SmartinspectPython loading the incorrect watchdog version.

I never ran into any problems using SpotifyPlus with HA 2025.7.x (including the latest 2025.7.3), so it must be some other integration that you have loaded that is loading watchdog==6.0.0 and causing SpotifyPlus to fail (due to watchdog==1.0.1 requirement; or vice-versa. I think HA only loads the watchdog library in certain situations (folder_watcher component?), of which I am obviously not using as I never had the issue.

Anyway, it should be fixed now, as of SpotifyPlus v1.0.147.

Thanks for bringing this to my attention.

thlucas1 avatar Jul 27 '25 14:07 thlucas1

Thanks! Hopefully, @GraysonCAdams was affected by the same cause. For me, it was just a coincidence that I updated both HA and SpotifyPlus at the same time, tricking me into thinking it was due to HA 2025.7.x update :)

robin-thoni avatar Jul 27 '25 16:07 robin-thoni

Thanks for getting to the bottom of the issue!

craigbarratt avatar Jul 27 '25 19:07 craigbarratt