Andre0512 / hon

Home Assistant integration for Haier hOn: support for Haier/Candy/Hoover home appliances like washing machines and air conditioners in 28 languages.
MIT License
1.22k stars 2.5k forks source link

ModuleNotFoundError: No module named 'imp' #164

Closed djvariado closed 2 months ago

djvariado commented 3 months ago

при запуске HA не запускается интеграция в логах следующая ошибка:

Setup failed for custom integration 'hon': Unable to import component: No module named 'imp' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 251, in _async_setup_component component = integration.get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 827, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 994, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/hon/init.py", line 2, in import imp ModuleNotFoundError: No module named 'imp'

AlbCod commented 2 months ago

hi, same problem

Setup failed for custom integration 'xiaomi_miot': Unable to import component: No module named 'imp'

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 251, in _async_setup_component component = integration.get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 827, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/importlib/init.py", line 90, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1387, in _gcd_import File "", line 1360, in _find_and_load File "", line 1331, in _find_and_load_unlocked File "", line 935, in _load_unlocked File "", line 994, in exec_module File "", line 488, in _call_with_frames_removed File "/config/custom_components/xiaomi_miot/init.py", line 32, in from miio import ( File "/usr/local/lib/python3.12/site-packages/miio/init.py", line 12, in from miio.device import Device, DeviceStatus # isort: skip ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/miio/device.py", line 13, in from .miioprotocol import MiIOProtocol File "/usr/local/lib/python3.12/site-packages/miio/miioprotocol.py", line 13, in import construct File "/usr/local/lib/python3.12/site-packages/construct/init.py", line 22, in from construct.core import * File "/usr/local/lib/python3.12/site-packages/construct/core.py", line 3, in import struct, io, binascii, itertools, collections, pickle, sys, os, tempfile, hashlib, importlib, imp ModuleNotFoundError: No module named 'imp'

Magicpulse commented 2 months ago

Same error

Andre0512 commented 2 months ago

This integration never used 'imp'. You probably use the old one from gvigroux, see gvigroux/hon#121

robertomontinaro80 commented 2 months ago

same problem here. Please fix it.

csPinKie commented 2 months ago

@robertomontinaro80 use python 3.11 as a workaround

emredemirhan commented 2 months ago

how can we use python 3.11?

csPinKie commented 2 months ago

how can we use python 3.11?

install python 3.11 from python.org and use it as your programming interpreter in your programming environment, idk what u use to code (i use pycharm)

robertomontinaro80 commented 2 months ago

@robertomontinaro80 use python 3.11 as a workaround

Sorry but I found a fork of the same integration which is maintained and available via hacs. I installed it and everything working fine for now. I'm currently using this https://github.com/gvigroux/hon

ruudleijnse commented 2 months ago

the issue is the import imp in the init.py if you repleace it with import importlib it should work. Or switch to https://github.com/gvigroux/hon