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
The first thing to check is probably /etc/hosts. Make sure that you have the following entry:
/etc/hosts
127.0.0.1 localhost
If the above does not work, then the following should do the trick:
sudo hostname -s 127.0.0.1