When installing Ansible from source, how can I make setup.py install to a certain directory instead of the build directory?

I was asked to install Ansible from source, so I am though I know I can “pip install ansible”

On a RHEL6.x VM. I have Python 2.7.14 and pip 9.0.1 installed. So I downloaded the tarball and extracted it in /path/ansible-source. Now I do

$ cd /path/ansible-source $ source ./hacking/env_setup $ pip install -r requirements.txt $ pip setup.py install

but this puts the executable in /path/ansible-source/build directory. I wan them to go to /usr/local/bin. Where do I set this up?

NVM, I did a “python2.7 setup.py build” before the “python2.7 setup.py install” step (not pip setup.py build) and that’s where the error is. So the correct steps are

$ cd /path/ansible-source
$ source ./hacking/env_setup
$ pip install -r requirements.txt
$ python2.7 setup.py install