I have build the Spark-csv and able to use the same from pyspark shell using the following command
bin/spark-shell --packages com.databricks:spark-csv_2.10:1
At the time I used spark-csv, I also had to download commons-csv
jar (not sure it is still relevant). Both jars where in the spark distribution folder.
I downloaded the jars as follow:
wget http://search.maven.org/remotecontent?filepath=org/apache/commons/commons-csv/1.1/commons-csv-1.1.jar -O commons-csv-1.1.jar
wget http://search.maven.org/remotecontent?filepath=com/databricks/spark-csv_2.10/1.0.0/spark-csv_2.10-1.0.0.jar -O spark-csv_2.10-1.0.0.jar
then started the python spark shell with the arguments:
./bin/pyspark --jars "spark-csv_2.10-1.0.0.jar,commons-csv-1.1.jar"
and read a spark dataframe from a csv file:
from pyspark.sql import SQLContext
sqlContext = SQLContext(sc)
df = sqlContext.load(source="com.databricks.spark.csv", path = "/path/to/you/file.csv")
df.show()