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

ImportError when importing 'override' from 'typing' with Python 3.11 #117167

Closed
Ledgerbiggg opened this issue May 10, 2024 · 1 comment
Closed

Comments

@Ledgerbiggg
Copy link

The problem

b7090496915a77ffec36257d1c02655

Upon attempting to run tests in a Home Assistant environment using Python 3.11, an ImportError is encountered. The error suggests that the override decorator, which should be available in Python 3.11, is not being imported successfully.

What version of Home Assistant Core has the issue?

core-2024.3.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

No response

Link to integration documentation on our website

No response

Diagnostics information

ImportError while loading conftest 'C:\projectpy\core\tests\conftest.py'.
...conftest.py:37: in
from . import patch_time # noqa: F401, isort:skip
...patch_time.py:8: in
from homeassistant import runner, util
...homeassistant\runner.py:18: in
from . import bootstrap
...homeassistant\bootstrap.py:40: in
from .components import (
...homeassistant\components\config_init_.py:12: in
from . import (
...homeassistant\components\config\automation.py:8: in
from homeassistant.components.automation.config import (
...homeassistant\components\automation_init_.py:58: in
from homeassistant.helpers import condition
...homeassistant\helpers\condition.py:18: in
from homeassistant.components.sensor import SensorDeviceClass
...homeassistant\components\sensor_init_.py:14: in
from typing import Any, Final, Self, cast, final, override
E ImportError: cannot import name 'override' from 'typing' (C:\Users\22866\AppData\Local\Programs\Python\Python311\Lib\typing.py)

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@Ledgerbiggg
Copy link
Author

I changed the version of Python to Python 3.12.3, and using this version also caused an error just now

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

1 participant