title: Trouble installing Pyspark
body: <p>I want to run Spark on a local machine using pyspark. From <a href="http://spark.apache.org/docs/0.9.1/python-programming-guide.html" rel="nofollow">here</a> I use the commands:</p>
  
  <pre><code>sbt/sbt assembly
  $ ./bin/pyspark 
  </code></pre>
  
  <p>The install completes, but pyspark is unable to run, resulting in the following error (in full):</p>
  
  <pre><code>138:spark-0.9.1 comp_name$ ./bin/pyspark
  Python 2.7.6 |Anaconda 1.9.2 (x86_64)| (default, Jan 10 2014, 11:23:15) 
  [GCC 4.0.1 (Apple Inc. build 5493)] on darwin
  Type "help", "copyright", "credits" or "license" for more information.
  Traceback (most recent call last):
    File "/Users/comp_name/Downloads/spark-0.9.1/python/pyspark/shell.py", line 32, in &lt;module&gt;
      sc = SparkContext(os.environ.get("MASTER", "local"), "PySparkShell", pyFiles=add_files)
    File "/Users/comp_name/Downloads/spark-0.9.1/python/pyspark/context.py", line 123, in __init__
      self._jsc = self._jvm.JavaSparkContext(self._conf._jconf)
    File "/Users/comp_name/Downloads/spark-0.9.1/python/lib/py4j-0.8.1-src.zip/py4j/java_gateway.py", line 669, in __call__
    File "/Users/comp_name/Downloads/spark-0.9.1/python/lib/py4j-0.8.1-src.zip/py4j/protocol.py", line 300, in get_return_value
  py4j.protocol.Py4JJavaError: An error occurred while calling None.org.apache.spark.api.java.JavaSparkContext.
  : java.net.UnknownHostException: 138.7.100.10.in-addr.arpa: 138.7.100.10.in-addr.arpa: nodename nor servname provided, or not known
      at java.net.InetAddress.getLocalHost(InetAddress.java:1466)
      at org.apache.spark.util.Utils$.findLocalIpAddress(Utils.scala:355)
      at org.apache.spark.util.Utils$.localIpAddress$lzycompute(Utils.scala:347)
      at org.apache.spark.util.Utils$.localIpAddress(Utils.scala:347)
      at org.apache.spark.util.Utils$.localIpAddressHostname$lzycompute(Utils.scala:348)
      at org.apache.spark.util.Utils$.localIpAddressHostname(Utils.scala:348)
      at org.apache.spark.util.Utils$$anonfun$localHostName$1.apply(Utils.scala:395)
      at org.apache.spark.util.Utils$$anonfun$localHostName$1.apply(Utils.scala:395)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.util.Utils$.localHostName(Utils.scala:395)
      at org.apache.spark.SparkContext.&lt;init&gt;(SparkContext.scala:124)
      at org.apache.spark.api.java.JavaSparkContext.&lt;init&gt;(JavaSparkContext.scala:47)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:234)
      at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:379)
      at py4j.Gateway.invoke(Gateway.java:214)
      at py4j.commands.ConstructorCommand.invokeConstructor(ConstructorCommand.java:79)
      at py4j.commands.ConstructorCommand.execute(ConstructorCommand.java:68)
      at py4j.GatewayConnection.run(GatewayConnection.java:207)
      at java.lang.Thread.run(Thread.java:724)
  Caused by: java.net.UnknownHostException: 138.7.100.10.in-addr.arpa: nodename nor servname provided, or not known
      at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
      at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:894)
      at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1286)
      at java.net.InetAddress.getLocalHost(InetAddress.java:1462)
      ... 22 more
  </code></pre>
  
  <p>Any ideas what I am doing wrong? I don't know where the IP address <code>138.7.100.10</code> comes from.
  I get this error when using (or not) MAMP to create a localhost.
  Thanks in advance!</p>