java.io.IOException: Cannot run program “python” using Spark in Pycharm (Windows)

I had the same problem as you, and then I made the following changes:
set PYSPARK_PYTHON as environment variable to point to python.exe in Edit Configurations of Pycharm, here is my example:

PYSPARK_PYTHON = D:\Anaconda3\python.exe

SPARK_HOME = D:\spark-1.6.3-bin-hadoop2.6

PYTHONUNBUFFERED = 1

Leave a Comment