python代码中的importfrom spark_learning.utils.default_utils import setDefaultEncoding,initSparkContext,ensureOffsetsubmit命令:bin/spark-submit --jars /home/jabo/software/spark-1.5.2-bin-hadoop2.6/lib/spark-streaming-kafka-assembly_2.10-1.5.2.jar\/home/jabo/spark-by-python/spark_learning/third_day/streaming_kafka_avg.py\
--py-files /home/jabo/spark-by-python/spark_learning/utils/default_utils.py官网解释:For Python applications, simply pass a .py file in the place of <application-jar> instead of a JAR, andadd Python .zip, .egg or .py files to the search path with --py-files.但是会报错,找不到import模块:Traceback (most recent call last): File "/home/jabo/spark-by-python/spark_learning/third_day/streaming_kafka_avg.py", line 10, in <module> import spark_learning.utils.default_utils
ImportError: No module named spark_learning.utils.default_utils如何解决??
- 2 回答
- 0 关注
- 1568 浏览
添加回答
举报
0/150
提交
取消