Setting Python path variables for Livy
To change the Python executable used by a Livy session, set environment variables or Spark configuration when you create the session.
pyspark
Livy reads the path from the PYSPARK_PYTHON environment variable (this
is the same as PySpark).
-
If Livy is running in
localmode, simply set the environment variable (this is the same as PySpark). -
If the Livy session is running in
yarn-clustermode, setspark.yarn.appMasterEnv.PYSPARK_PYTHONin theSparkConffile, so that the environment variable is passed to the driver. -
When you create a session through the Livy REST API, set
spark.pyspark.pythonandspark.yarn.appMasterEnv.PYSPARK_PYTHONin the sessionconfmap.
