cannot solve ModuleNotFoundError #607
Replies: 1 comment 2 replies
-
Does hewalex2mqtt use PyScript or is it a regular Python script? What I find on GitHub about hewalex2mqtt looks more like native Python or approaches that only use MQTT from Home Assistant or actually the broker itself. if PATH_DIR_PY_NATIVE not in sys.path:
sys.path.append(PATH_DIR_PY_NATIVE) Presumably there would also be possibilities to connect @pyscript_compile with dynamic imports, although this could quickly become confusing. But the question would be, if native, why the way via Pyscript. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a py file in use, the creator of which has lost interest in updating it. However, at the moment the only problem seems to be an error message
Exception in </config/pyscript/hewalex2mqtt.py> line 5: from hewalex_geco.devices import PCWU, ZPS ^ ModuleNotFoundError: No module named 'hewalex_geco'
the error is caused by the following line
from hewalex_geco.devices import PCWU, ZPS
where hewalex_geco.devices are folders where PCWU, ZPS files are located.
Is this bug? As I understand it should work!
Also when I use
from .hewalex_geco.devices import PCWU, ZPS
I get:
ImportError: attempted relative import with no known parent package
maybe someone has an idea how to fix this.
Beta Was this translation helpful? Give feedback.
All reactions