If you encounter this error after launching the pyspark prompt, this solution might work for you.
Change the permissions of the /tmp/hive directory as follows.
sudo chmod -R 777 /tmp/hive
Launch pyspark. If pyspark is added to your path, you can do
pyspark
or
./bin/pyspark
from the spark directory.