You will need a Marionette enabled Firefox build that you can successfully connect to.

Before installing gaiatest you may want to consider creating a virtual environment:

virtualenv env_name
source env_name/bin/activate

If you only want to use gaiatest without making changes:

pip install gaiatest

However, if you want to modify gaiatest, first clone the Gaia repository before running

git clone
cd gaia/tests/python/gaia-ui-tests
python develop