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

Kafka-python errore #2436

Open
alimajed92 opened this issue Apr 24, 2024 · 1 comment
Open

Kafka-python errore #2436

alimajed92 opened this issue Apr 24, 2024 · 1 comment

Comments

@alimajed92
Copy link

I'm encountering an issue with importing KafkaProducer from the kafka module. Here's the code I'm using:

from kafka import KafkaProducer

The error message I'm receiving is: "cannot import name 'KafkaProducer' from partially initialized module 'kafka' (most likely due to a circular import)".

I'm running Kafka on Docker, and it's functioning properly. My goal is simply to send messages from my Python file to Kafka.

I've tried uninstalling and reinstalling the kafka-python library, but I'm still having the same error.

Thanks for the help!

@alimajed92
Copy link
Author

The issue stemmed from the naming of my Python file, which coincidentally was named kafka.py. To resolve this, I renamed the file to something else.

After resolving the naming conflict, I encountered another error: "No module named 'kafka.vendor.six.moves'". The solution to this error was to uninstall kafka-python and install kafka-python-ng.
https://stackoverflow.com/questions/77287622/modulenotfounderror-no-module-named-kafka-vendor-six-moves-in-dockerized-djan

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