question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot import name 'CONF_ENERGY_INTEGRATION_METHOD'

See original GitHub issue

seeing

Package package_powercalc setup failed. Component powercalc cannot import name 'CONF_ENERGY_INTEGRATION_METHOD' from 'custom_components.powercalc.const' (/config/custom_components/powercalc/const.py), 

for all my sensors and:

2022-01-05 12:10:08 ERROR (MainThread) [homeassistant.config] Platform error: sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config.py", line 884, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 553, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 558, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/powercalc/__init__.py", line 29, in <module>
    from .const import (
ImportError: cannot import name 'CONF_ENERGY_INTEGRATION_METHOD' from 'custom_components.powercalc.const' (/config/custom_components/powercalc/const.py)

in the logs for all of them… running v0.14.0-beta.5 noticed version 14 was released so I just installed that, but makes no difference, same errors are displayed

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
bramstrokercommented, Jan 5, 2022

Now I understand what you mean, thanks.

Will have a look into the list index errors. Also reported by other user already.

0reactions
Mariusthvdbcommented, Jan 6, 2022

all Fine! magic. thanks a lot for fixing this so quickly!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix ImportError: Cannot Import Name in Python - Rollbar
The Python ImportError: cannot import name error occurs when an imported class is not accessible or is in a circular dependency.
Read more >
What can I do about "ImportError: Cannot import name X" or ...
You have circular dependent imports. physics.py is imported from entity before class Ent is defined and physics tries to import entity that is...
Read more >
cannot import name 'remote_pb2' from 'securexgboost.rpc ...
I am getting the following error importing securexgboost: secureml@fml-30294-westus2-sxgb-poc-sgxvm:~$ python3 Python 3.7.5 (default, ...
Read more >
How to Fix : “ImportError: Cannot import name X” in Python?
You can solve the “ImportError: Cannot import name X” Error by resolving the circular dependencies. You can do that either by eliminating ...
Read more >
cannot import name 'file_hash' from 'pooch.utils' - YouTube
How to resolve ImportError: cannot import name 'file_hash' from 'pooch.utils'
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found