Error with pyspark and anaconda environment

Viewed 233

I am trying to setup pyspark on windows10. Unfortunately, I am not able to run pyspark in my command prompt to check if it is working. It always results in The command pyspark is wrong or could no been found.

I have done the following according to the installations guide(https://sparkbyexamples.com/pyspark-tutorial/):

Install Anaconda (I have already installed it) Install Java 8 or later (C:\Program Files\Java\jdk1.8.0_311 ; C:\Program Files\Java\jre1.8.0_311) Add JAVA_HOME to variables (I have: C:\Program Files\Java\jdk1.8.0_311) Add to PATH (I have: C:\Program Files\Java\jdk1.8.0_311\bin) Install Apache Spark ( I have: C:\Users\moritz\spark) Set the following environment variables:

SPARK_HOME = C:\Users\moritz\spark
HADOOP_HOME = C:\Users\moritz\spark
PATH=%PATH%;C:\Users\moritz\spark\bin

Setup winutils.exe: Download and copy to %SPARK_HOME%\bin (C:\Users\moritz\spark\bin\winutils)

Unfortunately, when I am trying to run the cmd in command prompt it says that the command pyspark couldn't have been found. When I execute pyspark in anaconda prompt it works and a SparkSession is available.

But, most important, when I try to execute python script with SparkContext, the result is Java not found and JAVA_HOME Environment variable is not set.

I hope someone can help me, I am pretty sure I have messed something up with the environment variables and with using anaconda.

0 Answers
Related