Assuming one of the following:
- Spark is downloaded on your system and you have an environment variable
SPARK_HOME
pointing to it - You have ran
pip install pyspark
Here is a simple method (If you don’t bother about how it works!!!)
Use findspark
-
Go to your python shell
pip install findspark import findspark findspark.init()
-
import the necessary modules
from pyspark import SparkContext from pyspark import SparkConf
-
Done!!!