You can follow the below steps:
Change the working dir in order to set the checkpoint dir with sc.setCheckpointDir():
Next, create a directory on that route:
Set the checkpoint:
After that it will work.
To know more about it, get your Pyspark certification today and become expert.