Search code examples
javaapache-sparkpysparkstartup

pyspark not able to start


I am having Windows 8.1 operating system. I installed apache spark and then, installed Java JDK. I am using git bash in windows. I am having below setting in my .bash_profile of git bash.

export SPARK_HOME="/c/tools/spark-2.3.1-bin-hadoop2.7" 
export PATH="$SPARK_HOME/bin:$PATH"  
export JAVA_HOME="/c/Program Files (x86)/Java/jdk1.8.0_181/"

When I try to call pyspark, I am getting error as given below.

/c/tools/spark-2.3.1-bin-hadoop2.7/bin/pyspark: line 45: python: command not found Error: Could not find or load main class org.apache.spark.launcher.Main

I tried running spark-shell in the path "/c/tools/spark-2.3.1-bin-hadoop2.7/bin/". Still getting the same error.

Please help me in making pyspark running in my machine.


Solution

  • I was finally able to make pyspark work in Windows, by following the steps in the blog

    http://nishutayaltech.blogspot.com/2015/04/how-to-run-apache-spark-on-windows7-in.html

    I had to install few more tools and set environment variables and finally make it working.