Traceback (most recent call last):
File "//producer.py", line 1, in <module>
from kafka.producer import KafkaProducer
File "/usr/local/lib/python3.9/site-packages/kafka/__init__.py", line 23, in <module>
from kafka.producer import KafkaProducer
File "/usr/local/lib/python3.9/site-packages/kafka/producer/__init__.py", line 4, in <module>
from .simple import SimpleProducer
File "/usr/local/lib/python3.9/site-packages/kafka/producer/simple.py", line 54
return '<SimpleProducer batch=%s>' % self.async
^
SyntaxError: invalid syntax
I had seen an earlier error identical but I was using from kafka import KafkaProducer
My new python script uses from kafka.producer import KafkaProducer
but I still get the self.async error
You need to install kafka-python
, not kafka
package. If kafka
is installed, then you need to uninstall it and replace with the other
https://github.com/dpkp/kafka-python/issues/1566
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With