Spark Streaming's Kafka libraries not found in class path

背景

pyspark streaming 处理Kafka生产的数据时报错:
Spark Streaming’s Kafka libraries not found in class path. Try one of the following.
Spark Streaming's Kafka libraries not found in class path

reason

缺少 <spark-streaming-kafka-0-8-assembly.jar> 包

solution

包下载链接
Spark Streaming's Kafka libraries not found in class path
将下载的jar包放在
/opt/anaconda3/envs/python37/lib/python3.7/site-packages/pyspark/jars
目录下