Install homebrew:
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install python 2.7 from homebrew:
brew install python
brew install gcc
brew install wget
Use pip to install virtual env:
pip install virtualenv
Create a work directory and install scipy to it this keeps you scipy and dependencies seperate from the system:
mkdir scipy
virtualenv scipy
Activate your virtual environment and install scipy and tools:
cd scipy
source bin/activate
pip install matplotlib
pip install scipy
pip install h5py