title: Python error: Cannot import name KafkaConsumer
body: <p>I installed the kafka-python package for Python. I have a kafka producer and consumer running. I want the python code to read the kafka topic and print out the messages. </p>
  
  <p>My python code is below:</p>
  
  <pre><code>import sys
  from kafka import KafkaConsumer
  
  def kafkatest():
      print "Step 1 complete"
      consumer=KafkaConsumer('test',bootstrap_servers=['localhost:9092'])
      for message in consumer:
          print "Next message"
          print message
  
  
  if __name__=="__main__":
      kafkatest()
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>C:\Python27&gt;python.exe kafka.py Traceback (most recent call last):   File "kafka.py", line 2, in &lt;module&gt;
      from kafka import KafkaConsumer   File "C:\Python27\kafka.py", line 2, in &lt;module&gt;
      from kafka import KafkaConsumer ImportError: cannot import name KafkaConsumer
  </code></pre>
  
  <p>Any suggestions on what I am missing here?</p>