PySpark in iPython notebook raises Py4JJavaError when using count() and first()
I am using PySpark(v.2.1.0) in iPython notebook (python v.3.6) over virtualenv in my Mac(Sierra 10.12.3 Beta). 1.I launched iPython notebook by shooting this in Terminal - PYSPARK_PYTHON=python3 PYSPARK_DRIVER_PYTHON=ipython PYSPARK_DRIVER_PYTHON_OPTS="notebook" /Applications/spark-2.1.0-bin-hadoop2.7/bin/pyspark 2.Loaded my file to Spark Context and ensured its loaded- >>>lines = sc.textFile("/Users/PanchusMac/Dropbox/Learn_py/Virtual_Env/pyspark/README.md") >>>for i in lines.collect(): print(i) And it worked fine and printed the result over my console as shown: # Apache Spark Spark is a fast