title: Issues Google Cloud Storage connector on Spark
body: <p>I am trying to install the Google Cloud Storage on Spark on Mac OS to do local testing of my Spark app. I have read the following document (<a href="https://cloud.google.com/hadoop/google-cloud-storage-connector" rel="nofollow">https://cloud.google.com/hadoop/google-cloud-storage-connector</a>). I have added "gcs-connector-latest-hadoop2.jar" in my spark/lib folder. I have also added the core-data.xml file in the spark/conf directory.</p>
  
  <p>When I run my pyspark shell, I get an error:</p>
  
  <pre><code>&gt;&gt;&gt; sc.textFile("gs://mybucket/test.csv").count()
      Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/Users/poiuytrez/Documents/DataBerries/programs/spark/python/pyspark/rdd.py", line 847, in count
      return self.mapPartitions(lambda i: [sum(1 for _ in i)]).sum()
    File "/Users/poiuytrez/Documents/DataBerries/programs/spark/python/pyspark/rdd.py", line 838, in sum
      return self.mapPartitions(lambda x: [sum(x)]).reduce(operator.add)
    File "/Users/poiuytrez/Documents/DataBerries/programs/spark/python/pyspark/rdd.py", line 759, in reduce
      vals = self.mapPartitions(func).collect()
    File "/Users/poiuytrez/Documents/DataBerries/programs/spark/python/pyspark/rdd.py", line 723, in collect
      bytesInJava = self._jrdd.collect().iterator()
    File "/Users/poiuytrez/Documents/DataBerries/programs/spark/python/lib/py4j-0.8.2.1-src.zip/py4j/java_gateway.py", line 538, in __call__
    File "/Users/poiuytrez/Documents/DataBerries/programs/spark/python/lib/py4j-0.8.2.1-src.zip/py4j/protocol.py", line 300, in get_return_value
  py4j.protocol.Py4JJavaError: An error occurred while calling o26.collect.
  : java.lang.RuntimeException: java.lang.ClassNotFoundException: Class com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem not found
      at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1895)
      at org.apache.hadoop.fs.FileSystem.getFileSystemClass(FileSystem.java:2379)
      at org.apache.hadoop.fs.FileSystem.createFileSystem(FileSystem.java:2392)
      at org.apache.hadoop.fs.FileSystem.access$200(FileSystem.java:89)
      at org.apache.hadoop.fs.FileSystem$Cache.getInternal(FileSystem.java:2431)
      at org.apache.hadoop.fs.FileSystem$Cache.get(FileSystem.java:2413)
      at org.apache.hadoop.fs.FileSystem.get(FileSystem.java:368)
      at org.apache.hadoop.fs.Path.getFileSystem(Path.java:296)
      at org.apache.hadoop.mapred.FileInputFormat.singleThreadedListStatus(FileInputFormat.java:256)
      at org.apache.hadoop.mapred.FileInputFormat.listStatus(FileInputFormat.java:228)
      at org.apache.hadoop.mapred.FileInputFormat.getSplits(FileInputFormat.java:304)
      at org.apache.spark.rdd.HadoopRDD.getPartitions(HadoopRDD.scala:179)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:204)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:202)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.rdd.RDD.partitions(RDD.scala:202)
      at org.apache.spark.rdd.MappedRDD.getPartitions(MappedRDD.scala:28)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:204)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:202)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.rdd.RDD.partitions(RDD.scala:202)
      at org.apache.spark.api.python.PythonRDD.getPartitions(PythonRDD.scala:56)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:204)
      at org.apache.spark.rdd.RDD$$anonfun$partitions$2.apply(RDD.scala:202)
      at scala.Option.getOrElse(Option.scala:120)
      at org.apache.spark.rdd.RDD.partitions(RDD.scala:202)
      at org.apache.spark.SparkContext.runJob(SparkContext.scala:1135)
      at org.apache.spark.rdd.RDD.collect(RDD.scala:774)
      at org.apache.spark.api.java.JavaRDDLike$class.collect(JavaRDDLike.scala:305)
      at org.apache.spark.api.java.JavaRDD.collect(JavaRDD.scala:32)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at py4j.reflection.MethodInvoker.invoke(MethodInvoker.java:231)
      at py4j.reflection.ReflectionEngine.invoke(ReflectionEngine.java:379)
      at py4j.Gateway.invoke(Gateway.java:259)
      at py4j.commands.AbstractCommand.invokeMethod(AbstractCommand.java:133)
      at py4j.commands.CallCommand.execute(CallCommand.java:79)
      at py4j.GatewayConnection.run(GatewayConnection.java:207)
      at java.lang.Thread.run(Thread.java:744)
  Caused by: java.lang.ClassNotFoundException: Class com.google.cloud.hadoop.fs.gcs.GoogleHadoopFileSystem not found
      at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:1801)
      at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1893)
      ... 40 more
  </code></pre>
  
  <p>I am not sure where to go next.</p>