Skip to content

ImportError #2231

@codingjoe

Description

Hi there 👋,

40e8a6f imports type annotations directly from typing_extensions instead of doing

import typing
try:
    import typing_extensions
except ImportError:
    pass
from typing import Self

as the documentation suggests.

Note that the typing-extensions dependency is only included for Python < 3.11

typing-extensions; python_version < "3.11"

So if you install the package using Python 3.12, you'll end up with the following ImportError:

    from confluent_kafka.aio import AIOConsumer
.venv/lib/python3.14/site-packages/confluent_kafka/aio/__init__.py:15: in <module>
    from ._AIOConsumer import AIOConsumer
.venv/lib/python3.14/site-packages/confluent_kafka/aio/_AIOConsumer.py:20: in <module>
    from typing_extensions import Self
E   ModuleNotFoundError: No module named 'typing_extensions'

source

Cheers!
Joe

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions