First install the dependencies:
sudo pip install numpy scipy Theano PyYAML
Then install CGML:
sudo python setup.py clean build install