Why does spark-submit and spark-shell fail with “Failed to find Spark assembly JAR. You need to build Spark before running this program.”?

前端 未结 9 1675
一个人的身影
一个人的身影 2020-12-17 07:33

I was trying to run spark-submit and I get \"Failed to find Spark assembly JAR. You need to build Spark before running this program.\" When I try to run spark-shell

相关标签:
9条回答
  • 2020-12-17 08:35

    If your spark binaries are in a folder where the name of the folder has spaces (for example, "Program Files (x86)"), it didn't work. I changed it to "Program_Files", then the spark_shell command works in cmd.

    0 讨论(0)
  • 2020-12-17 08:35

    If you have downloaded binary and getting this exception

    Then please check your Spark_home path may contain spaces like "apache spark"/bin

    Just remove spaces will works.

    0 讨论(0)
  • 2020-12-17 08:37
    1. Go to SPARK_HOME. Note that your SPARK_HOME variable should not include /bin at the end. Mention it when you're when you're adding it to path like this: export PATH=$SPARK_HOME/bin:$PATH

    2. Run export MAVEN_OPTS="-Xmx2g -XX:ReservedCodeCacheSize=1g" to allot more memory to maven.

    3. Run ./build/mvn -DskipTests clean package and be patient. It took my system 1 hour and 17 minutes to finish this.

    4. Run ./dev/make-distribution.sh --name custom-spark --pip. This is just for python/pyspark. You can add more flags for Hive, Kubernetes, etc.

    Running pyspark or spark-shell will now start pyspark and spark respectively.

    0 讨论(0)
提交回复
热议问题