-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[Python 3.12.0] ModuleNotFoundError: No module named 'kafka.vendor.six.moves' #2401
Comments
On the latest Python 3.11 it works: $ python --version
Python 3.11.6
$ pip freeze
kafka-python==2.0.2
$ python
Python 3.11.6 (main, Oct 10 2023, 17:17:53) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from kafka.consumer.group import KafkaConsumer
>>> KafkaConsumer
<class 'kafka.consumer.group.KafkaConsumer'>
>>> |
It seems this might be resolved by bumping $ pip freeze
six==1.11.0
$ python
Python 3.12.0 (main, Oct 9 2023, 10:31:21) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from six.moves import range
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'six.moves' however: $ pip freeze
six==1.16.0
$ python
Python 3.12.0 (main, Oct 9 2023, 10:31:21) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from six.moves import range
>>> (On Python 3.11.6 However, this might not be enough, see benjaminp/six#376 (this one might not be relevant, but there might be other random issues like this). |
It turns out there already is a relevant PR waiting for review. |
Until the above PR is merged and a new version of this library is released, running the snippet below before importing import six
if sys.version_info >= (3, 12, 0):
sys.modules['kafka.vendor.six.moves'] = six.moves |
Given
my system:
Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:23 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6020 arm64
Current behaviour
Expected behaviour
(no error)
The text was updated successfully, but these errors were encountered: