kafka-python consumer giving errors
<p>I am fairly new to kafka and kafka-python. After installing kafka-python, I tried a naive implementation of the consumer code from here - <a href="http://kafka-python.readthedocs.io/en/master/usage.html" rel="nofollow">http://kafka-python.readthedocs.io/en/master/usage.html</a></p>

<p>I have been writing the consumer code from the bin directory in kafka and tried running the python code from there. However I get the following errors:</p>

<blockquote>
  <p>Traceback (most recent call last):
    File "KafkaConsumer.py", line 4, in 
      for message in consumer:
    File "/usr/local/lib/python2.7/dist-packages/kafka/vendor/six.py", line 559, in next
      return type(self).<strong>next</strong>(self)
    File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/group.py", line 915, in <strong>next</strong>
      return next(self._iterator)
    File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/group.py", line 876, in _message_generator
      for msg in self._fetcher:
    File "/usr/local/lib/python2.7/dist-packages/kafka/vendor/six.py", line 559, in next
      return type(self).<strong>next</strong>(self)
    File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/fetcher.py", line 520, in <strong>next</strong>
      return next(self._iterator)
    File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/fetcher.py", line 477, in _message_generator
      for msg in self._unpack_message_set(tp, messages):
    File "/usr/local/lib/python2.7/dist-packages/kafka/consumer/fetcher.py", line 372, in _unpack_message_set
      inner_mset = msg.decompress()
    File "/usr/local/lib/python2.7/dist-packages/kafka/protocol/message.py", line 121, in decompress
      assert has_snappy(), 'Snappy decompression unsupported'
  AssertionError: Snappy decompression unsupported</p>
</blockquote>

<p>And this is the code that I have been trying to run:</p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code>from kafka import KafkaConsumer
consumer = KafkaConsumer ('mytopic',bootstrap_servers = ['localhost:9092'], group_id='test-consumer-group')
print "Consuming messages from the given topic"
for message in consumer:
    print("%s:%d%d: key=%s value=%s"  % (message.topic, message.partition, message.offset, message.key, message.value))</code></pre>
</div>
</div>
</p>

<p>Since, I'm really new to Kafka, I'm having trouble understanding what I am doing wrong.</p>