How do I set the driver's python version in spark?
I came across the same error message and I have tried three ways mentioned above. I listed the results as a complementary reference to others.

Change the PYTHON_SPARK and PYTHON_DRIVER_SPARK value in spark-env.sh does not work for me.
Change the value inside python script using os.environ["PYSPARK_PYTHON"]="/usr/bin/python3.5"
os.environ["PYSPARK_DRIVER_PYTHON"]="/usr/bin/python3.5" does not work for me.
Change the value in ~/.bashrc works like a charm~
I'm using spark 1.4.0-rc2 so I can use python 3 with spark.  If I add export PYSPARK_PYTHON=python3 to my .bashrc file, I can run spark interactively with python 3.  However, if I want to run a standalone program in local mode, I get an error:

Exception: Python in worker has different version 3.4 than that in
driver 2.7, PySpark cannot run with different minor versions

How can I specify the version of python for the driver?  Setting export PYSPARK_DRIVER_PYTHON=python3 didn't work.