search

Home  >  Q&A  >  body text

pip - 已经安装kafka-python ,ImportError: cannot import name KafkaConsumer

已经安装kafka-python (1.3.2.dev0)版本,但是ImportError: cannot import name KafkaConsumer

from kafka import KafkaConsumer
consumer = KafkaConsumer('test')
for msg in consumer:

print(msg)

http://kafka-python.readthedo...按照文档使用的为啥啊

ringa_leeringa_lee2802 days ago1843

reply all(1)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-18 10:10:17

    You need to install from github master - KafkaProducer is not released to pypi yet.
    https://github.com/dpkp/kafka...

    reply
    0
  • Cancelreply