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

2024.11.0.b3 introduces a new error: No module named 'nordpool.base' #438

Closed
mhoogenbosch opened this issue Nov 4, 2024 · 24 comments
Closed

Comments

@mhoogenbosch
Copy link

New beta new issue:

Logger: homeassistant.setup
Bron: setup.py:334
Eerst voorgekomen: 13:09:08 (1 gebeurtenissen)
Laatst gelogd: 13:09:08

Setup failed for custom integration 'nordpool': Unable to import component: No module named 'nordpool.base'
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 1031, in async_get_component
    self._component_future.result()
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1011, 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 1071, 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/nordpool/__init__.py", line 16, in <module>
    from .aio_price import AioPrices, InvalidValueException
  File "/config/custom_components/nordpool/aio_price.py", line 10, in <module>
    from nordpool.base import CurrencyMismatch
ModuleNotFoundError: No module named 'nordpool.base'
@quasd
Copy link

quasd commented Nov 4, 2024

This has nothing to do with ha release, this is due to nordpool library updating. ( https://github.com/kipe/nordpool/releases/tag/0.4.3 )

Dirty workaround

config/custom_components/nordpool/manifest.json

orginal line

"nordpool>=0.2"

roll back to old release

"nordpool==0.4.2",

and restart HA

@mhoogenbosch
Copy link
Author

Did your dirty workaround and indeed, it works again. Should I close the issue?

@arghle
Copy link
Contributor

arghle commented Nov 4, 2024

No, this should be fixed in the integration. Relying on "revision>=number" was bound to break eventually I guess.

arghle added a commit to arghle/nordpool that referenced this issue Nov 4, 2024
Apparently the nordpool package introduced a backwards incompatibility in the 0.4.3 minor version. This just pins the package to version 0.4.2.
@arghle
Copy link
Contributor

arghle commented Nov 4, 2024

Here's @quasd 's hack as a PR: #439 . Should maybe ask the owner of that nordpool package to respect https://semver.org/ for their versioning, a minor version bump shouldn't have broken backwards compatibility.

@AEkman
Copy link

AEkman commented Nov 5, 2024

Here's @quasd 's hack as a PR: #439 . Should maybe ask the owner of that nordpool package to respect https://semver.org/ for their versioning, a minor version bump shouldn't have broken backwards compatibility.

I created an issue for this:
kipe/nordpool#56

@992tts
Copy link

992tts commented Nov 5, 2024

Thanks quasd for a quick fix. Have been working with this error hours without success.
Now it's fixed.
quasd you made my day :-)

@RezzZ
Copy link

RezzZ commented Nov 5, 2024

so I tried updating the manifest. How do I perform the rollback after that? just restarting HA? Or do I redownload the same version from HACS?

edit: ahh my bad, the file didn't save on unraid as HA changes ownership of files. I now saved it, restarted HA and intergration is back online. thanks for the workaround. hope this gets fixed in nordpool soon

@hwikene
Copy link

hwikene commented Nov 6, 2024

image

I get this. Just updated to 2024.11.0

@sla004
Copy link

sla004 commented Nov 6, 2024

you have typo, correct line is nordpool==0.4.2

@kongjudas
Copy link

I had a cold shower this morning, since the boiler hasn't been running for days. Do we really need the version state in there? That means we have to make another automation to remind us checking the version on every integration.

@Diondk
Copy link

Diondk commented Nov 7, 2024

I had a cold shower this morning, since the boiler hasn't been running for days. Do we really need the version state in there? That means we have to make another automation to remind us checking the version on every integration.

i think you should create an automation to check if the boiler has been running the last day.. 😄
But yes version number is required in the manifest.json since: 2021.6: https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes/#versions

@mortenx
Copy link

mortenx commented Nov 7, 2024

Error
Config flow could not be loaded: {"message":"Invalid handler specified"}

@madd0x2000
Copy link

I had a cold shower this morning, since the boiler hasn't been running for days. Do we really need the version state in there? That means we have to make another automation to remind us checking the version on every integration.

Sounds like a bad idea to base the boiler running times just on nordpool prices.

@Tommixoft
Copy link

This is 100% problem of HomeAssistant not nordpool. Just updated to latest version HA and nordpool no longer works.
Hate when breaking working things!

@Tommixoft
Copy link

Tommixoft commented Nov 7, 2024

I had a cold shower this morning, since the boiler hasn't been running for days. Do we really need the version state in there? That means we have to make another automation to remind us checking the version on every integration.

Sounds like a bad idea to base the boiler running times just on nordpool prices.

Or just HA team could stop breaking things. It's very good automation i run similar stuff myself, not boiler but battery charging based on energy price.
It worked second before update to HA 2024.11. Still waiting when they fix Energy dashboard that broke months ago.

@arghle
Copy link
Contributor

arghle commented Nov 7, 2024

Please be civil, all the work here is done by volunteers.

This is 100% problem of HomeAssistant not nordpool.

This is technically correct, but pretty imprecise. The problem here is:

  • The home-assitant nordpool integration (which is not maintained by HomeAssistant, but by other volunteers as a community component) has a buggy requirement line which would cause a breakage sooner or later
  • The nordpool python package (which is not maintained by HomeAssistant, nor Nordpool, but another set of volunteers) is misbehaving with how it uses versioning for its package

Installing these custom components (via HACS or otherwise) means you may sometimes wake up with a cold shower, because this isn't a perfect supported commercial SW. It IS annoying, but blaming "HA team" is missing the mark.

Cheers!

@Dutchy-79
Copy link

Same error, did edit the version and rebooted though didn't solve it

@stefancn
Copy link

stefancn commented Nov 7, 2024

Please, Please . Rush this problem as many relies on the prices from NordPool

//S

Hellowlol added a commit that referenced this issue Nov 7, 2024
@experts007
Copy link

experts007 commented Nov 7, 2024

I waste few hours just now to solve this issue. Please check this.
#438 (comment)
Its help me. Many thanks to @quasd !

@Hellowlol
Copy link
Collaborator

Thanks for bringing this to my attention. It should be fixed in the new version

@stefancn
Copy link

stefancn commented Nov 7, 2024

Thank you so very much for your fast assistance ... My wife salutes you , now she can take a hot shower tomorrow 👍

@MarcelAtSmartshore
Copy link

Great to have this update!

@fmessi
Copy link

fmessi commented Nov 7, 2024

same problem, same fix... thanks a lot!!!

one question: but... isn't 0.4.2 > 0.2 ???
why doesn't it work?

@arghle
Copy link
Contributor

arghle commented Nov 8, 2024

one question: but... isn't 0.4.2 > 0.2 ???
why doesn't it work?

0.4.2 is indeed > 0.2. The problem was the upstream package this refers to published version 0.4.3, which is also > 0.2. Python package dependencies means that if you tell it to install >= 0.2, it can pick any version that is greater than 0.2, and defaults to the latest one. So specifying >=0.2 is not great, and would eventually break if the API ever changed.

(Ideally the upstream should have been published as 0.5.0 or 1.0.0, but it would still have broken this integration, since ">0.2" isn't safe.)

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