I am trying to save dataframe into file using the pyspark method but I am getting above error. IThe same code I am trying in python 2.7, there it is working but python 3.6 it is