Skip to content

Commit

Permalink
Pass PYTHONPATH to executor
Browse files Browse the repository at this point in the history
  • Loading branch information
Sephiroth-Lin committed Apr 12, 2015
1 parent 5d8f7b9 commit 413fa25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,11 @@ private[spark] class Client(
env(ENV_DIST_CLASSPATH) = dcp
}

sys.env.get("PYTHONPATH") match {
case Some(pythonPath) => env("PYTHONPATH") = pythonPath
case None => // do nothing
}

env
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ class ExecutorRunnable(
}

System.getenv().filterKeys(_.startsWith("SPARK")).foreach { case (k, v) => env(k) = v }

sys.env.get("PYTHONPATH") match {
case Some(pythonPath) => env("PYTHONPATH") = pythonPath
case None => // do nothing
}

env
}
}

0 comments on commit 413fa25

Please sign in to comment.