installation in terminal
The reason why Ubuntu works is that it has a package manager for all code, that is python and binaries. pip is a python installer and works in OSX for all pure python packages and simple C packages but seems to have issues with the more complex ones.

The nearest think to Linux's package managers are the package managers that deal with code ported from other Unices e.g. Macports, Homebrew, Fink. With choose one and one only as they can conflict (I use macports) and then use it for all possible ports.

In your case installing matplotlib would automatically install python, numpy, scipy etc