Apache Spark: How to use pyspark with Python 3

tchakravarty picture tchakravarty · May 16, 2015 · Viewed 83.5k times · Source

I built Spark 1.4 from the GH development master, and the build went through fine. But when I do a bin/pyspark I get the Python 2.7.9 version. How can I change this?

Answer

Rtik88 picture Rtik88 · Aug 19, 2015

Just set the environment variable:

export PYSPARK_PYTHON=python3

in case you want this to be a permanent change add this line to pyspark script.