Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting error after upgrading to 2024.10.0 #62

Closed
kaizersoje opened this issue Oct 3, 2024 · 13 comments
Closed

Getting error after upgrading to 2024.10.0 #62

kaizersoje opened this issue Oct 3, 2024 · 13 comments

Comments

@kaizersoje
Copy link
Contributor

After upgrading to 2024.10.0, the integration is not getting loaded and am seeing these errors in the logs.

2024-10-03 17:48:17.685 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package pyastroweatherio==0.60.3: error: Failed to prepare distributions
Caused by: Failed to fetch wheel: pyephem==9.99
Caused by: Failed to install requirements from `build-system.requires` (install)
Caused by: Failed to install build dependencies
Caused by: Failed to install: setuptools-75.1.0-py3-none-any.whl (setuptools==75.1.0)
Caused by: The wheel is invalid: metadata field Metadata-Version not found
2024-10-03 17:48:21.822 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package pyastroweatherio==0.60.3: error: Failed to prepare distributions
Caused by: Failed to fetch wheel: pyastroweatherio==0.60.3
Caused by: Failed to install requirements from `build-system.requires` (install)
Caused by: Failed to install build dependencies
Caused by: Failed to install: setuptools-75.1.0-py3-none-any.whl (setuptools==75.1.0)
Caused by: The wheel is invalid: metadata field Metadata-Version not found
@mawinkler
Copy link
Owner

Hmmm, I just upgraded to 2024.10.0 and at least with the current main I'm running I don't get this error. Will check again before releasing a new version with some nice features from Uptonight.

@kaizersoje
Copy link
Contributor Author

Still getting error after installing 0.61.0

Logger: homeassistant.util.package
Source: util/package.py:150
First occurred: 06:43:52 (6 occurrences)
Last logged: 06:44:27

Unable to install package pyastroweatherio==0.61.0: error: Failed to prepare distributions Caused by: Failed to fetch wheel: pyastroweatherio==0.61.0 Caused by: Failed to install requirements from `build-system.requires` (install) Caused by: Failed to install build dependencies Caused by: Failed to install: setuptools-75.1.0-py3-none-any.whl (setuptools==75.1.0) Caused by: The wheel is invalid: metadata field Metadata-Version not found
Unable to install package pyastroweatherio==0.61.0: error: Failed to prepare distributions Caused by: Failed to fetch wheel: pyephem==9.99 Caused by: Failed to install requirements from `build-system.requires` (install) Caused by: Failed to install build dependencies Caused by: Failed to install: setuptools-75.1.0-py3-none-any.whl (setuptools==75.1.0) Caused by: The wheel is invalid: metadata field Metadata-Version not found
Unable to install package icalevents!=0.1.28: error: Failed to install: icalendar-5.0.13-py3-none-any.whl (icalendar==5.0.13) Caused by: The wheel is invalid: metadata field Metadata-Version not found

@mawinkler
Copy link
Owner

I tested it again on 2024.10.1 and 2024.11.0.dev0 (fresh dev container) but cannot replicate your error.

@kaizersoje
Copy link
Contributor Author

I have got HA OS installed on a RPi4. I have a similar issue with another integration. Raised issue for that as well.

Not sure if this is a core issue or not.

@kaizersoje
Copy link
Contributor Author

After upgrading to 2024.10.1, the errors are different now

Logger: homeassistant.setup
Source: setup.py:334
First occurred: 17:21:47 (1 occurrences)
Last logged: 17:21:47

Setup failed for custom integration 'astroweather': Unable to import component: cannot import name 'FORECAST_TYPE_HOURLY' from 'pyastroweatherio' (/usr/local/lib/python3.12/site-packages/pyastroweatherio/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/astroweather/__init__.py", line 7, in <module>
    from pyastroweatherio import FORECAST_TYPE_HOURLY, AstroWeather
ImportError: cannot import name 'FORECAST_TYPE_HOURLY' from 'pyastroweatherio' (/usr/local/lib/python3.12/site-packages/pyastroweatherio/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1019, in async_get_component
    comp = self._get_component()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/astroweather/__init__.py", line 7, in <module>
    from pyastroweatherio import FORECAST_TYPE_HOURLY, AstroWeather
ImportError: cannot import name 'FORECAST_TYPE_HOURLY' from 'pyastroweatherio' (/usr/local/lib/python3.12/site-packages/pyastroweatherio/__init__.py)

@mawinkler
Copy link
Owner

mawinkler commented Oct 7, 2024

Strange. I now tested the current version on
image
on amd64 (need to find a raspi ;-)) and it works as hoped.

I just built a pyastroweatherio for you to try. To test change the astroweather manifest to 0.60.0.2.

@kaizersoje
Copy link
Contributor Author

Strange. I now tested the current version on image on amd64 (need to find a raspi ;-)) and it works as hoped.

I just built a pyastroweatherio for you to try. To test change the astroweather manifest to 0.60.0.2.

I changed the version of astroweather to 0.60.0.2. pyastroweatherio is still set to 0.61.0

2024-10-10 15:15:54.653 ERROR (SyncWorker_5) [homeassistant.util.package] Installed version for pyastroweatherio resolved to None

Logger: homeassistant.setup
Source: setup.py:334
First occurred: 15:16:18 (1 occurrences)
Last logged: 15:16:18

Setup failed for custom integration 'astroweather': Unable to import component: cannot import name 'FORECAST_TYPE_HOURLY' from 'pyastroweatherio' (/usr/local/lib/python3.12/site-packages/pyastroweatherio/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/astroweather/__init__.py", line 7, in <module>
    from pyastroweatherio import FORECAST_TYPE_HOURLY, AstroWeather
ImportError: cannot import name 'FORECAST_TYPE_HOURLY' from 'pyastroweatherio' (/usr/local/lib/python3.12/site-packages/pyastroweatherio/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1019, in async_get_component
    comp = self._get_component()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/astroweather/__init__.py", line 7, in <module>
    from pyastroweatherio import FORECAST_TYPE_HOURLY, AstroWeather
ImportError: cannot import name 'FORECAST_TYPE_HOURLY' from 'pyastroweatherio' (/usr/local/lib/python3.12/site-packages/pyastroweatherio/__init__.py)

@mawinkler
Copy link
Owner

Sorry, my fault, I was not precise enough. In the manifest of astroweather please set the versions as below:

    "requirements": [
        "pyastroweatherio==0.61.0.2"
    ],
    "version": "0.61.0"

This leaves astroweather at the current release version but changes the library to the updated one.

@kaizersoje
Copy link
Contributor Author

I set this in the manifest as you mentioned.

    "requirements": [
        "pyastroweatherio==0.61.0.2"
    ],
    "version": "0.61.0"

Still getting the same error

Logger: homeassistant.setup
Source: setup.py:334
First occurred: 16:14:39 (1 occurrences)
Last logged: 16:14:39

Setup failed for custom integration 'astroweather': Unable to import component: cannot import name 'FORECAST_TYPE_HOURLY' from 'pyastroweatherio' (/usr/local/lib/python3.12/site-packages/pyastroweatherio/__init__.py)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1007, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/astroweather/__init__.py", line 7, in <module>
    from pyastroweatherio import FORECAST_TYPE_HOURLY, AstroWeather
ImportError: cannot import name 'FORECAST_TYPE_HOURLY' from 'pyastroweatherio' (/usr/local/lib/python3.12/site-packages/pyastroweatherio/__init__.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1027, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1019, in async_get_component
    comp = self._get_component()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1067, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 200, in protected_loop_func
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 995, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/astroweather/__init__.py", line 7, in <module>
    from pyastroweatherio import FORECAST_TYPE_HOURLY, AstroWeather
ImportError: cannot import name 'FORECAST_TYPE_HOURLY' from 'pyastroweatherio' (/usr/local/lib/python3.12/site-packages/pyastroweatherio/__init__.py)

I restarted HA twice.

@mawinkler
Copy link
Owner

I released 0.61.1 which hopefully fixes your issues

@kaizersoje
Copy link
Contributor Author

It works. If I may ask, what was the issue? I noticed a dew other intergrations have similar issue with the py libraries which are not getting resolved.

@mawinkler
Copy link
Owner

Of course you can. So the problem didn't exist on amd64, only on arm64. That's why I couldn't replicate it at first.

The logs you sent and the logs from issue #63 pointed me to the dependencies, especially on the setuptools package. I updated all of them to their current releases. This fixed your problem and and one of @0utc45t's.

There was still the problem with FORECAST_TYPE_HOURLY which I removed from the module imports and AstroWeather as I only do hourly forecasts.

The other problem in issue #63 was actually not relevant for this dependency issue here.

So in a nutshell, my guess is that the issue is caused by home assistant now using uv instead of pip and that there was an incompatibility with the quite outdated setuptools I was using in pyastroweatherio. But this is just a guess.

@mawinkler
Copy link
Owner

Fixed with 0.61.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants