can not import kafkaProducer in spark streaming job
<p>I have a simple <code>spark streaming</code> job that tracks an <code>HDFS</code> directory, read the newly added files, and send it to <code>Kafka</code>. </p>

<p>When submitting the spark job it does not work and throw the following exception. </p>

<blockquote>
  <p>ImportError: cannot import name KafkaProducer</p>
</blockquote>

<p>Here is the code of the job (<a href="http://pastebin.com/mpKkMkph" rel="nofollow">http://pastebin.com/mpKkMkph</a>)</p>

<p>The error is clear. The script can not import <code>kafkaProducer</code>.  The problem is that I can import it from the <code>python shell</code> without any problem. </p>