Fix setup.py to not attempt importing uninstalled libraries.

Currently `python setup.py install` cannot be run because of the error `ImportError: No module named requests`.

Using the method outlined in http://stackoverflow.com/questions/458550/standard-way-to-embed-version-into-python-package fixes this problem.

There is another issue with some dependency conflicts which is not fixed in this PR.