title: Spark: Run Spark shell from a different directory than where Spark is installed on slaves and master
body: <p>I have a small cluster (4 machines) set up with 3 slaves and a master node, all installed to <code>/home/spark/spark</code>. (I.e, <code>$SPARK_HOME</code> is <code>/home/spark/spark</code>)</p>
  
  <p>When I use the spark shell: <code>/home/spark/spark/bin/pyspark --master spark://192.168.0.11:7077</code> everything works fine. However I'd like for my colleagues to be able to connect to the cluster from a local instance of spark on their machine installed in whatever directory they wish. </p>
  
  <p>Currently if somebody has spark installed in say <code>/home/user12/spark</code> and run <code>/home/user12/spark/bin/pyspark --master spark://192.168.0.11:7077</code> the spark shell will connect to the master without problems but fails with an error when I try to run code:</p>
  
  <pre><code>    class java.io.IOException: Cannot run program 
      "/home/user12/bin/compute-classpath.sh"
      (in directory "."): error=2, No such file or directory)
  </code></pre>
  
  <p>The problem here is that Spark is looking for the spark installation in <strong>/home/user12/spark/</strong>, where as I'd like to just tell spark to look in <strong>/home/spark/spark/</strong> instead.</p>
  
  <p>How do I do this?</p>