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

Unable to import component: No module named 'pywattbox.base' #17

Open
garyak opened this issue Nov 15, 2023 · 5 comments
Open

Unable to import component: No module named 'pywattbox.base' #17

garyak opened this issue Nov 15, 2023 · 5 comments

Comments

@garyak
Copy link

garyak commented Nov 15, 2023

Core 2023.11.2
Supervisor 2023.11.3
Operating System 11.1
Frontend 20231030.2

Version of the custom_component

v0.9.0b1

Configuration

wattbox:

  • host: !secret wattbox1_ip
    username: !secret it_user
    password: !secret it_psswd
    name: wattbox1
    resources:
    • current_value
    • power_value
    • voltage_value
  • host: !secret wattbox2_ip
    username: !secret it_user
    password: !secret it_psswd
    name: wattbox2
    resources:
    • current_value
    • power_value
    • voltage_value

HA Log Error

2023-11-15 14:47:43.778 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration wattbox: Unable to import component: No module named 'pywattbox.base'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 215, in _async_setup_component
    component = integration.get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 816, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/wattbox/__init__.py", line 28, in <module>
    from pywattbox.base import BaseWattBox
ModuleNotFoundError: No module named 'pywattbox.base'

Describe the bug

Invalid config
The following integrations and platforms could not be set up:

Debug log


Unable to restart due to bad config

@eseglem
Copy link
Owner

eseglem commented Nov 20, 2023

Forgot I was still pointing it at GitHub directly and the dependency is a bit funky because of that. I'll try to push a new release of pywattbox and point at it instead tomorrow. If you pip install the requirements.txt manually, it should work in the meantime.

@eseglem
Copy link
Owner

eseglem commented Nov 20, 2023

Hopefully v0.9.0b2 fixes this. Should be up. I'll try and test it more later as well.

@eseglem
Copy link
Owner

eseglem commented Nov 20, 2023

Actually had a few more issues with dependencies, and mine not wanting to build stuff. Think I got past that all now.

Latest is now v0.9.0b5

@garyak
Copy link
Author

garyak commented Nov 20, 2023

9.0b5 started. No errors. I'll check it out in more detail over the next few days. Entity names didn't seem to change. Customization worked without edits.

@garyak
Copy link
Author

garyak commented Nov 30, 2023

Ran into the entity renaming issue this morning. I now have two sets of outlet entities. The original outlet numbering (switch.wattbox2_outlet_1) and a set entity names of earlier customization (switch.wattbox2_ruku). Entity order as presented in the entities listing is not according to outlet numbering making reassignment difficult. What's best going forward to restore entity names to outlet numbering versus customized naming?

Update: I restored an earlier backup and moved 8.2 in. Updated to 11.3 and the old entity names remain (switch.wattbox2_outlet_1). I haven't rebooted the host system yet.

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