Open Plawasan opened 10 months ago
Simply just update the lxml
dependency to 4.9.4
.
Created a PR to address this https://github.com/slesinger/HomeAssistant-PREdistribuce/pull/19
Thanks, I've updated the manifest manually, works now.
Similar issue after update on HA 2024.10.0
Platform error 'binary_sensor' from integration 'predistribuce' - cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py) Platform error 'sensor' from integration 'predistribuce' - cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py)
Tried to update lxml but no change
pip install lxml
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: lxml in /usr/lib/python3/dist-packages (4.6.3)
@kimosak do you have still the issue?
@mazzy89 yes, "sensor" not working from 2024.10 to 2024.10.3
Logger: homeassistant.config Zdroj: config.py:1413 První výskyt: 21. října 2024 v 22:21:04 (1 výskyty) Naposledy logováno: 21. října 2024 v 22:21:04
Platform error: binary_sensor - cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 1413, in _async_load_and_validate_platform_integration
platform = await p_integration.integration.async_get_platform(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1100, in async_get_platform
platforms = await self.async_get_platforms((platform_name,))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1177, in async_get_platforms
import_future.result()
File "/usr/src/homeassistant/homeassistant/loader.py", line 1165, in async_get_platforms
platforms.update(self._load_platforms(platform_names))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1090, in _load_platforms
platform_name: self._load_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1264, in _load_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1296, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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/predistribuce/binary_sensor.py", line 12, in <module>
from lxml import html, etree
File "/usr/local/lib/python3.12/site-packages/lxml/html/__init__.py", line 53, in <module>
from .. import etree
ImportError: cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py)
I cannot reproduce on my side. Can you report which lxml version do you have?
I hope this one is the current one lxml in /usr/lib/python3/dist-packages (4.6.3)
@mazzy89 lxml updated to 5.3.0 but there is still error
Platform error 'binary_sensor' from integration 'predistribuce' - cannot import name 'etree' from 'lxml' (/usr/local/lib/python3.12/site-packages/lxml/__init__.py)
how have you installed HA?
I used phoscon image based on Raspberry Pi OS and docker
Operating System: Raspbian GNU/Linux 11 (bullseye) Kernel: Linux 6.6.47-v8+
Client: Docker Engine - Community Version: 26.1.4 API version: 1.45 Go version: go1.21.11 Git commit: 5650f9b Built: Wed Jun 5 11:28:55 2024
After updating to 2024.1.0, all sensors are unavailable, this is what logs say:
Diky