Before you install xray, be sure you have the required dependencies installed. The easiest way to do so is to use the Anaconda python distribution.
To install xray, use pip:
pip install xray
To run the test suite after installing xray, install nose and run nosetests xray.