custom-components/pyscript

Can't Install PyScript Integration Due to croniter Dependency

Opened this issue · 2 comments

I am trying to install PyScript integration. I added PyScript using HACS but when I try to add the integration I get an error, Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble. I did restart Home Assistant before trying to install the integration.

The issue appears to be that croniter is no longer available. If you check pypi.org/croniter, you see UNMAINTAINED/ABANDONED CODE / DO NOT USE.

I have attached my logs but you really only need to first and last lines.

I am running Home Assistant Core 2025.2.4.

homeassistant  | 2025-02-20 16:59:33.173 INFO (MainThread) [homeassistant.requirements] Multiple attempts to install croniter==2.0.2 failed, install will be retried after next configuration check or restart
homeassistant  | 2025-02-20 16:59:33.173 ERROR (MainThread) [aiohttp.server] Error handling request from 172.19.0.20
homeassistant  | Traceback (most recent call last):
homeassistant  |   File "/usr/local/lib/python3.13/site-packages/aiohttp/web_protocol.py", line 480, in _handle_request
homeassistant  |     resp = await request_handler(request)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/local/lib/python3.13/site-packages/aiohttp/web_app.py", line 569, in _handle
homeassistant  |     return await handler(request)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/local/lib/python3.13/site-packages/aiohttp/web_middlewares.py", line 117, in impl
homeassistant  |     return await handler(request)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
homeassistant  |     return await handler(request)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 210, in forwarded_middleware
homeassistant  |     return await handler(request)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
homeassistant  |     return await handler(request)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 86, in ban_middleware
homeassistant  |     return await handler(request)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
homeassistant  |     return await handler(request)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
homeassistant  |     response = await handler(request)
homeassistant  |                ^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
homeassistant  |     result = await handler(request, **request.match_info)
homeassistant  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
homeassistant  |     return await func(self, request, *args, **kwargs)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
homeassistant  |     return await method(view, request, data, *args, **kwargs)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 172, in post
homeassistant  |     return await self._post_impl(request, data)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 179, in _post_impl
homeassistant  |     return await super()._post_impl(request, data)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 83, in _post_impl
homeassistant  |     result = await self._flow_mgr.async_init(
homeassistant  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |     ...<2 lines>...
homeassistant  |     )
homeassistant  |     ^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1309, in async_init
homeassistant  |     flow, result = await self._async_init(flow_id, handler, context, data)
homeassistant  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1334, in _async_init
homeassistant  |     flow = await self.async_create_flow(handler, context=context, data=data)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1530, in async_create_flow
homeassistant  |     handler = await _async_get_flow_handler(
homeassistant  |               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |         self.hass, handler_key, self._hass_config
homeassistant  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |     )
homeassistant  |     ^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 3327, in _async_get_flow_handler
homeassistant  |     await _load_integration(hass, domain, hass_config)
homeassistant  |   File "/usr/src/homeassistant/homeassistant/config_entries.py", line 3304, in _load_integration
homeassistant  |     await async_process_deps_reqs(hass, hass_config, integration)
homeassistant  |   File "/usr/src/homeassistant/homeassistant/setup.py", line 581, in async_process_deps_reqs
homeassistant  |     await requirements.async_get_integration_with_requirements(
homeassistant  |         hass, integration.domain
homeassistant  |     )
homeassistant  |   File "/usr/src/homeassistant/homeassistant/requirements.py", line 54, in async_get_integration_with_requirements
homeassistant  |     return await manager.async_get_integration_with_requirements(domain)
homeassistant  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/requirements.py", line 170, in async_get_integration_with_requirements
homeassistant  |     await future
homeassistant  |   File "/usr/src/homeassistant/homeassistant/requirements.py", line 159, in async_get_integration_with_requirements
homeassistant  |     await self._async_process_integration(integration, done)
homeassistant  |   File "/usr/src/homeassistant/homeassistant/requirements.py", line 182, in _async_process_integration
homeassistant  |     await self.async_process_requirements(
homeassistant  |         integration.domain, integration.requirements
homeassistant  |     )
homeassistant  |   File "/usr/src/homeassistant/homeassistant/requirements.py", line 264, in async_process_requirements
homeassistant  |     self._raise_for_failed_requirements(name, missing)
homeassistant  |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
homeassistant  |   File "/usr/src/homeassistant/homeassistant/requirements.py", line 292, in _raise_for_failed_requirements
homeassistant  |     raise RequirementsNotFound(integration, [req])
homeassistant  | homeassistant.requirements.RequirementsNotFound: Requirements for pyscript not found: ['croniter==2.0.2'].

Wes.

I had the same issue also in the past.
I had to setup my python dependency for my container in the folder hass/config/deps:

- name: PYTHONPATH
  "$PYTHONPATH:/config/deps"

I am not sure why this happened but I needed to upgrade both croniter and watchdog to my Home Assistant container:

cd hass/config/deps
pip install --target=./ watchdog==6.0.0 --upgrade
pip install --target=./ croniter==6.0.0 --upgrade

@wstrater croniter is moved last week below pallets-eco (see pallets-eco/croniter#144 for info why kiorky did not wanted to be the maintainer of the package)
AFAIK the code won't be removed and will be supported/maintained by the pallets-eco team.