Step 1:
https://pypi.python.org/pypi/setuptools#unix-based-systems-including-mac-os-x
This is not available on OSX 10.9. Fix this first.
Step 2:
https://github.com/jcrocholl/pep8
Clone as ZIP, and run
python setup.py install
Step 3:
https://pypi.python.org/pypi/autopep8/
python setup.py install
Enjoy it!