pnbruckner / ha-entity-tz

Home Assistant Entity Time Zone Sensor
The Unlicense
3 stars 0 forks source link

2024.10 beta Requirements for entity_tz not found: ['timezonefinder==5.2.0']. #16

Open Mariusthvdb opened 2 weeks ago

Mariusthvdb commented 2 weeks ago

Entity TZ integration error thrown during beta 2024.10 Entity_tz version 1.2.1

Logger: homeassistant.setup Bron: setup.py:269 Eerst voorgekomen: 22:32:57 (1 gebeurtenissen) Laatst gelogd: 22:32:57

Setup failed for custom integration 'entity_tz': Requirements for entity_tz not found: ['timezonefinder==5.2.0'].

and

Logger: homeassistant.util.package Bron: util/package.py:150 Eerst voorgekomen: 22:32:53 (3 gebeurtenissen) Laatst gelogd: 22:32:56

Unable to install package timezonefinder==5.2.0: error: Failed to prepare distributions Caused by: Failed to fetch wheel: timezonefinder==5.2.0 Caused by: Build backend failed to determine extra requires with build_wheel() with exit status: 1 --- stdout: --- stderr: Traceback (most recent call last): File "", line 14, in File "/root/.cache/uv/builds-v0/.tmpDQFUcl/lib/python3.12/site-packages/setuptools/build_meta.py", line 332, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=[]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/.cache/uv/builds-v0/.tmpDQFUcl/lib/python3.12/site-packages/setuptools/build_meta.py", line 302, in _get_build_requires self.run_setup() File "/root/.cache/uv/builds-v0/.tmpDQFUcl/lib/python3.12/site-packages/setuptools/build_meta.py", line 503, in run_setup super().run_setup(setup_script=setup_script) File "/root/.cache/uv/builds-v0/.tmpDQFUcl/lib/python3.12/site-packages/setuptools/build_meta.py", line 318, in run_setup exec(code, locals()) File "", line 4, in File "/root/.cache/uv/sdists-v4/pypi/timezonefinder/5.2.0/Tiod5IrBgaK-rotCipmJu/timezonefinder-5.2.0.tar.gz/timezonefinder/init.py", line 2, in from timezonefinder.timezonefinder import TimezoneFinder, TimezoneFinderL File "/root/.cache/uv/sdists-v4/pypi/timezonefinder/5.2.0/Tiod5IrBgaK-rotCipmJu/timezonefinder-5.2.0.tar.gz/timezonefinder/timezonefinder.py", line 11, in from numpy import array, dtype, empty, frombuffer, fromfile ModuleNotFoundError: No module named 'numpy' ---

According to Frenck:

Makes sense, no valid wheels available: https://pypi.org/project/timezonefinder/#files

And Joost:

The library they use need to be properly distributed via PyPi We changed internals on how libraries are installed So like, we now hit this, but it could also happen at a later point in time it would happen eventually

pnbruckner commented 2 weeks ago

I got the same result when I tried running 2024.10.0b0. But when I went back to 2024.9.3, it worked just fine. Also, I created a separate Python 3.12 venv and installed timezonefinder, and that worked ok, too. So, it seems they broke something in 2024.10.0b0. Not sure there is anything I can do about it.

Mariusthvdb commented 2 weeks ago

yes it's what Joost said, they changed internals.

I can ask him whether he can assist in fixing this?

pnbruckner commented 2 weeks ago

As far as I can tell, the problem is either 1) the authors of timezonefinder did not properly distribute on pypi.org, or 2) the authors of HomeAssistant are being too restrictive. I don't claim to know which it is. Like I said, I can install it just fine using pip, so I'm not sure why HA's equivalent can't. But, again, not sure there's anything I can do about it. Maybe you could post an issue on the timezonefinder project.

pnbruckner commented 2 weeks ago

Not sure it's 100% related, but found this: https://github.com/jannikmi/timezonefinder/issues/243

Mariusthvdb commented 2 weeks ago

as far as I understood the devs , they have the 1 perspective.

I certainly want to issue in the timezonefinder project, though I fear as a mere user of your integration, my description wouldn't be as succinct as required.

But, let me try.. I really use your integration and want it back;-)

update https://github.com/jannikmi/timezonefinder/issues/250

pnbruckner commented 2 weeks ago

You might also try newer versions of timezonefinder by modifying manifest.json. As far as I can tell, the API that my integration uses hasn't changed.

Mariusthvdb commented 2 weeks ago

You might also try newer versions of timezonefinder by modifying manifest.json.

where can I find those versions?

pnbruckner commented 2 weeks ago

https://pypi.org/project/timezonefinder/#history

https://github.com/jannikmi/timezonefinder/releases

Looks like 5.2.0 was the last 5.x release.

Mariusthvdb commented 2 weeks ago

o dear, and we're using 5.2.0, thats a long time ago in their history.. will it hurt (be much heavier ion the system) to just add the latest?

update

"timezonefinder==6.5.3" brought everything back

will keep an eye on the processor, but this is good news.

pnbruckner commented 2 weeks ago

I think I was using 5.2.0 because that's what I had been using with the composite integration, and I didn't want to deal with a major version change. I would think latest & greatest is probably best. I have no idea if there's any difference in CPU usage, good or bad. I'll give 6.5.3 a try, too. If it works for both of us, I'll go ahead and release a new version of the integration with that manifest.json update.

pnbruckner commented 2 weeks ago

Released 1.2.2 w/ updated timezonefinder version.

edu24x commented 1 week ago

Hi. After updating the component I can't uninstall the integration. Regards

`Registrador: aiohttp.server Fuente: /usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py:448 Ocurrió por primera vez: 11:11:55 (1 ocurrencias) Última vez registrado: 11:11:55

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request resp = await request_handler(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 117, in impl return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) ^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, request.match_info) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper return await method(view, request, data, args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 172, in post return await self._post_impl(request, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 179, in _post_impl return await super()._post_impl(request, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 84, in _post_impl result = await self._flow_mgr.async_init( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1287, in async_init flow, result = await self._async_init(flow_id, handler, context, data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1312, in _async_init flow = await self.async_create_flow(handler, context=context, data=data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1499, in async_create_flow handler = await _async_get_flow_handler( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2959, in _async_get_flow_handler await _load_integration(hass, domain, hass_config) File "/usr/src/homeassistant/homeassistant/config_entries.py", line 2936, in _load_integration await async_process_deps_reqs(hass, hass_config, integration) File "/usr/src/homeassistant/homeassistant/setup.py", line 575, in async_process_deps_reqs await requirements.async_get_integration_with_requirements( File "/usr/src/homeassistant/homeassistant/requirements.py", line 54, in async_get_integration_with_requirements return await manager.async_get_integration_with_requirements(domain) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/requirements.py", line 170, in async_get_integration_with_requirements await future File "/usr/src/homeassistant/homeassistant/requirements.py", line 159, in async_get_integration_with_requirements await self._async_process_integration(integration, done) File "/usr/src/homeassistant/homeassistant/requirements.py", line 182, in _async_process_integration await self.async_process_requirements( File "/usr/src/homeassistant/homeassistant/requirements.py", line 264, in async_process_requirements self._raise_for_failed_requirements(name, missing) File "/usr/src/homeassistant/homeassistant/requirements.py", line 292, in _raise_for_failed_requirements raise RequirementsNotFound(integration, [req]) homeassistant.requirements.RequirementsNotFound: Requirements for entity_tz not found: ['timezonefinder==6.5.3'].`

And installing custom component (ignoring the warning that the integration is still installed):

`Logger: homeassistant.loader Source: loader.py:671 First occurred: 11:18:00 (1 occurrences) Last logged: 11:18:00

Error parsing manifest.json file at /config/custom_components/google_geocode/manifest.json: unexpected character: line 8 column 3 (char 201)`

`Registrador: homeassistant.util.package Fuente: util/package.py:150 Ocurrió por primera vez: 11:21:57 (3 ocurrencias) Última vez registrado: 11:22:17

Unable to install package timezonefinder==6.5.3: error: Failed to prepare distributions Caused by: Failed to fetch wheel: h3==3.7.7 Caused by: Build backend failed to build wheel through build_wheel() with exit status: 1 --- stdout: -------------------------------------------------------------------------------- -- Trying 'Ninja' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'Ninja' generator - failure -------------------------------------------------------------------------------- -------------------------------------------------------------------------------- -- Trying 'Unix Makefiles' generator -------------------------------- --------------------------- ---------------------- ----------------- ------------ ------- -- Not searching for unused variables given on the command line. -- Configuring incomplete, errors occurred! -- ------- ------------ ----------------- ---------------------- --------------------------- -------------------------------- -- Trying 'Unix Makefiles' generator - failure -------------------------------------------------------------------------------- --- stderr: CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. **** scikit-build could not get a working generator for your system. Aborting build. Building Linux wheels for Python 3.12 requires a compiler (e.g gcc). But scikit-build does NOT know how to install it on alpine To build compliant wheels, consider using the manylinux system described in PEP-513. Get it with "dockcross/manylinux-x64" docker image: https://github.com/dockcross/dockcross#readme For more details, please refer to scikit-build documentation: http://scikit-build.readthedocs.io/en/latest/generators.html#linux **** ---

Registrador: homeassistant.setup Fuente: setup.py:269 Ocurrió por primera vez: 11:22:17 (1 ocurrencias) Última vez registrado: 11:22:17

Setup failed for custom integration 'entity_tz': Requirements for entity_tz not found: ['timezonefinder==6.5.3'].`

pnbruckner commented 4 days ago

@edu24x how are you trying to install and uninstall the entity_tz custom integration?

edu24x commented 4 days ago

@edu24x how are you trying to install and uninstall the entity_tz custom integration?

Removing the services, but the integration persists.

https://github.com/user-attachments/assets/93857269-90e3-4afd-b735-1f5d251c045e

pnbruckner commented 3 days ago

You're showing how you're attempting to remove the configuration entries for the integration, not how you installed or attempted to uninstall it. So, how did you install it? HACS?

What version of HA are you using?

The bottom line is, the error says timezonefinder 6.5.3 can't be found, but it is definitely on pypi.org (i.e., https://pypi.org/project/timezonefinder/). So, I have no idea what HA's problem is.

FWIW, I'm using entity_tz 1.2.2 just fine on HA 2024.10.1.

edu24x commented 3 days ago

09-10-2024_01-07-14

I followed the instructions. In HACS I downloaded the custom repository and installed it. Then I searched for the integration and installed it. The problem is that now I can't update the repository because it tells me that to do so I have to uninstall the integration first and if I ignore that warning it installs 1.2.2 but not the timezonefinder==6.5.3 module.

So if I can't uninstall the integration first, it can't be updated correctly. How do I uninstall the integration, I don't see that option?

https://github.com/user-attachments/assets/c2c1767f-039a-458b-81eb-7d920c272481

pnbruckner commented 2 days ago

When HACS installs the custom integration, as far as I know, it is NOT responsible for installing the integration's requirements (in this case, timezonefinder.) It is HA's responsibility to make sure the integration's requirements are installed when it starts the integration. This would normally only happen the first time the integration is started after it is installed. HA is having trouble doing that for some reason on your system (but does not have a problem doing so on my system.)

So, you should not need to uninstall or reinstall the custom integration. But, if you want to uninstall it, you would do that via HACS, not HA's integration page. HA's integration page is only for removing configuration entries. (And you should not need to remove the configuration entry or entries before removing the custom integration.)

edu24x commented 1 day ago

That's what I do. I try to remove the custom integration from HACS, but it warns me that in order to remove it I must first remove the integration.

10-10-2024_18-42-59

The warning gives me two options: navigate to the HA integrations page (there is no option to uninstall) or ignore the warning (it lets me remove the custom integration).

10-10-2024_18-53-11

But if I reinstall the custom integration from HACS I get the errors in the log mentioned above and the integration does not work.

Regards

pnbruckner commented 1 day ago

Could you try adding the following to your configuration.yaml file?

logger:
  default: info
  logs:
    homeassistant.loader: debug
    homeassistant.setup: debug
    homeassistant.util.package: debug

Restart HA (with entity_tz installed), and look for any messages in the log that contain any of the following strings:

entity_tz
timezonefinder

FWIW, this is what I see:

2024-10-10 12:46:01.102 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration entity_tz which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-10 12:46:03.195 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'application_credentials', 'sun2', 'met', 'homeassistant_alerts', 'logbook', 'input_number', 'google_maps', 'gpslogger', 'backup', 'stream', 'schedule', 'system_health', 'energy', 'input_text', 'lovelace', 'nest', 'input_select', 'assist_pipeline', 'illuminance', 'persistent_notification', 'sensor', 'stt', 'trace', 'diagnostics', 'media_source', 'uptime', 'script', 'automation', 'device_automation', 'scene', 'ffmpeg', 'template', 'intent', 'conversation', 'zone', 'sun', 'file_upload', 'tag', 'mobile_app', 'hacs', 'person', 'input_boolean', 'entity_tz', 'config', 'blueprint', 'image_upload', 'analytics', 'map', 'input_button', 'input_datetime', 'history', 'counter', 'default_config', 'composite', 'timer', 'my', 'tts', 'hardware', 'onboarding', 'search', 'wake_word'}
2024-10-10 12:46:03.258 DEBUG (MainThread) [homeassistant.setup] Dependency entity_tz will wait for dependencies dict_keys(['zone'])
2024-10-10 12:46:04.554 INFO (SyncWorker_2) [homeassistant.util.package] Attempting install of timezonefinder==6.5.3
2024-10-10 12:46:04.554 DEBUG (SyncWorker_2) [homeassistant.util.package] Running uv pip command: args=['uv', 'pip', 'install', '--quiet', 'timezonefinder==6.5.3', '--index-strategy', 'unsafe-first-match', '--upgrade', '--constraint', '/usr/src/homeassistant/homeassistant/package_constraints.txt']
2024-10-10 12:46:13.402 DEBUG (MainThread) [homeassistant.loader] Component entity_tz import took 0.185 seconds (loaded_executor=True)
2024-10-10 12:46:13.402 INFO (MainThread) [homeassistant.setup] Setting up entity_tz
edu24x commented 1 day ago
2024-10-11 00:35:46.891 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'entity_tz': Requirements for entity_tz not found: ['timezonefinder==6.5.3'].
2024-10-11 00:35:19.314 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'energy', 'androidtv_remote', 'filesize', 'pyscript', 'device_automation', 'conversation', 'cover', 'sensor', 'todoist', 'template', 'ble_monitor', 'system_health', 'mqtt', 'input_number', 'scene', 'stt', 'cast', 'emulated_hue', 'workday', 'scheduler', 'shopping_list', 'utility_meter', 'my', 'notify', 'androidtv', 'sun', 'panel_custom', 'co2signal', 'person', 'proximity', 'local_calendar', 'schedule', 'application_credentials', 'integration', 'rpi_power', 'shelly', 'mobile_app', 'entity_tz', 'broadlink', 'telegram_bot', 'ffmpeg', 'yeelight', 'tasmota', 'patch', 'systemmonitor', 'timer', 'counter', 'ibeacon', 'raspberry_pi', 'config', 'group', 'input_button', 'composite', 'life360', 'input_select', 'netatmo', 'switch', 'wyoming', 'script', 'bodymiscale', 'ourgroceries', 'blueprint', 'zone', 'alexa_media', 'backup', 'binary_sensor', 'assist_pipeline', 'input_boolean', 'google_translate', 'camera', 'file', 'input_datetime', 'search', 'onboarding', 'wake_word', 'spotcast', 'xiaomi_ble', 'dlna_dms', 'tag', 'stream', 'bluetooth_adapters', 'map', 'smartir', 'sonoff', 'tts', 'google_sheets', 'media_source', 'ping', 'local_todo', 'python_script', 'intent', 'start_time', 'hardware', 'google_maps', 'owntracks', 'media_player', 'sql', 'cert_expiry', 'file_upload', 'matter', 'analytics', 'diagnostics', 'trace', 'persistent_notification', 'ideenergy', 'default_config', 'esphome', 'spotify', 'intent_script', 'hass_agent', 'input_text', 'history', 'hacs', 'button',
'automation', 'uptime', 'logbook', 'device_tracker', 'lovelace', 'homeassistant_alerts', 'nodered', 'command_line', 'min_max', 'image_upload', 'version', 'wemo', 'met'}
2024-10-11 00:35:10.767 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration entity_tz which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-10-11 00:35:46.891 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'entity_tz': Requirements for entity_tz not found: ['timezonefinder==6.5.3'].
2024-10-11 00:35:46.872 ERROR (SyncWorker_0) [homeassistant.util.package] Unable to install package timezonefinder==6.5.3: error: Failed to prepare distributions
  Caused by: Failed to fetch wheel: h3==3.7.7
  Caused by: Build backend failed to build wheel through `build_wheel()` with exit status: 1
pnbruckner commented 1 day ago

What hardware are you running on?

edu24x commented 20 hours ago

Raspberry Pi 4 4GB with an SSD.

pnbruckner commented 11 hours ago

@edu24x, that probably explains why it works for me but not for you. I'm running HA on an Intel based system, and you're running on an ARM based system. It's also possible your system is not configured correctly given the original errors you shared which showed it couldn't build wheels due to lack of gcc. What kind of HA install are you using?

BTW, I did not see any DEBUG messages from you above. Are you sure you enabled the ones I asked for and then restarted HA? I'd really like to see the one from your system that is equivalent to this one from my system:

2024-10-10 12:46:04.554 DEBUG (SyncWorker_2) [homeassistant.util.package] Running uv pip command: args=['uv', 'pip', 'install', '--quiet', 'timezonefinder==6.5.3', '--index-strategy', 'unsafe-first-match', '--upgrade', '--constraint', '/usr/src/homeassistant/homeassistant/package_constraints.txt']
edu24x commented 8 hours ago

Yes, here it is. I had changed some parameters in the logger configuration:

2024-10-11 18:48:37.054 DEBUG (SyncWorker_0) [homeassistant.util.package] Running uv pip command: args=['uv', 'pip', 'install', '--quiet', 'timezonefinder==6.5.3', '--index-strategy', 'unsafe-first-match', '--upgrade', '--constraint', '/usr/src/homeassistant/homeassistant/package_constraints.txt']

I have HAOS 2024.10.1, the integration has been working fine for months, I don't know exactly in which update it stopped working, with the "not loaded" warning.

11-10-2024_19-02-13

Definitely, Is there any way to delete the entity_tz integration from the integrations page or from some configuration file to retry the installation from the beginning?

pnbruckner commented 7 hours ago

Ok, that "uv pip install" command is the same, as expected. No surprises there.

I'm pretty sure the problem started with 2024.10, with this change:

https://www.home-assistant.io/blog/2024/10/02/release-202410/#faster-upgrades-when-using-custom-integrations

This changes how HA installs pypi.org packages that integrations use. In this case, it appears h3 (which is used indirectly by timezonefinder) installs ok on x86, but not on ARM.

I doubt that any reinstalling of entity_tz will make any difference. The problem is not the installation of the entity_tz integration, but the installation of the pypi.org packages it uses (indirectly.)

I honestly have no idea what the ultimate fix could/would be. I suspect it is either the h3 package itself, or the "wheel" infrastructure in HAOS.

@Mariusthvdb, any ideas? Do you run on ARM hardware, or x86?

Mariusthvdb commented 6 hours ago

running x86 here, and never looked back after the change in HA beta and using "timezonefinder==6.5.3"