The problem is the same as described here Error when starting spark-shell local on Mac
... but I have failed to find a solution. I also used to get the malformed URI err
If you are using pyspark, use the config method to set the host driver to localhost.
spark = (SparkSession .builder .appName( "temp1" ) .config( "spark.driver.host", "localhost" ) .getOrCreate() )