title: How do I install pyspark for use in standalone scripts?
body: <p>I'm am trying to use Spark with Python. I installed the Spark 1.0.2 for Hadoop 2 binary distribution from the <a href="https://spark.apache.org/downloads.html" rel="noreferrer">downloads</a> page. I can run through the quickstart examples in Python interactive mode, but now I'd like to write a standalone Python script that uses Spark. The <a href="https://spark.apache.org/docs/0.9.0/python-programming-guide.html#standalone-use" rel="noreferrer">quick start documentation</a> says to just import <code>pyspark</code>, but this doesn't work because it's not on my PYTHONPATH.</p>
  
  <p>I can run <code>bin/pyspark</code> and see that the module is installed beneath <code>SPARK_DIR/python/pyspark</code>. I can manually add this to my PYTHONPATH environment variable, but I'd like to know the preferred automated method.</p>
  
  <p>What is the best way to add <code>pyspark</code> support for standalone scripts? I don't see a <code>setup.py</code> anywhere under the Spark install directory. How would I create a pip package for a Python script that depended on Spark?</p>