title: Spark - Snappy library not available
body: <p>I trying to save a Mllib model.</p>
  <p>Code that I have run in Spark:</p>
  <pre><code>model = RandomForest.trainClassifier(train_data, 
                                   numClasses=2, categoricalFeaturesInfo=categoricalFeaturesInfo,
                                   numTrees=numTrees, featureSubsetStrategy=&quot;auto&quot;,
                                   impurity=impurity, maxDepth=maxDepth, maxBins=maxBins)
  
  model.save(sc, &quot;file:///path/to/models/model_name&quot;)
  </code></pre>
  <p>The error message was:</p>
  <pre class="lang-none prettyprint-override"><code>native snappy library not available: 
  this version of libhadoop was built without snappy support
  </code></pre>
  <h3>Spark's information</h3>
  <p>Spark version:</p>
  <p>1.6.1</p>
  <p>Code to start Spark:</p>
  <pre><code>pyspark --packages com.databricks:spark-csv_2.11:1.5.0 --master &quot;local[8]&quot; --driver-memory 6G --executor-memory 6G --jars /usr/local/path/to/hadoop/lib/snappy-java-1.0.4.1.jar
  </code></pre>
  <p>Environment variables (spark_env.sh):</p>
  <pre><code>HADOOP_HOME=/usr/local/path/to/hadoop 
  SPARK_HOME=/usr/local/path/to/spark
  HADOOP_CONF_DIR=/usr/local/path/to/hadoop/etc/hadoop
  SPARK_CONF_DIR=/usr/local/path/to/spark/conf
  HADOOP_LZO_DIR=/usr/local/path/to/hadoop/lib
  HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/local/path/to/spark/*:/usr/local/path/to/spark/lib/*:/usr/local/path/to/hadoop/lib/*:/usr/local/path/to/hadoop/lib/native/*
  LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/path/to/hadoop/lib/native
  SPARK_CLASSPATH=$SPARK_CLASSPATH:/usr/local/path/to/hadoop/lib/native/*:/usr/local/path/to/hadoop/lib/snappy-java-1.0.4.1.jar:/usr.local/path/to/spark/lib/*:$CLASSPATH
  </code></pre>
  <p>I purposefully added <code>/usr/local/path/to/hadoop/lib/snappy-java-1.0.4.1.jar</code> in SPARK_CLASSPATH to no avail.</p>