I am getting bellow error while trying to run pyspark.
java gateway process exited before sending the driver its port number
One possible reason behind getting this error is JAVA_HOME is not set or another reason may be the java is not installed.
I solved the issue by following bellow by running
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer