How to trouble shoot ‘python’ is not recognized as an internal or external command, operable program or batch file on Windows when running PySpark?

  apache-spark, pyspark, python, windows

When I type Pyspark in my cmd prompt or windows powershell I get C:UsersbillAppDataLocalProgramsPythonPython39' is not recognized as an internal or external command, operable program or batch file.

and when I run pyspark in git bash it returns set PYSPARK_SUBMIT_ARGS="--name" "PySparkShell" "pyspark-shell" && C:UsersbillAppDataLocalProgramsPythonPython39 C:UsersbillSparkspark-3.2.0-bin-hadoop2.7/bin/spark-class: line 96: CMD: bad array subscript

However python is set in my system path and when I type which python in git bash I get /c/Users/bill/AppData/Local/Programs/Python/Python39/python and python –version returns Python 3.9.7.

I installed Java, winutils.exe, and Spark following these instructions and I also pip installed pyspark successfully. Why would pyspark not be able to call python?

Source: Windows Questions

LEAVE A COMMENT