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

**URL:** <https://forum.ansible.com/t/when-installing-ansible-from-source-how-can-i-make-setup-py-install-to-a-certain-directory-instead-of-the-build-directory/25996>\
**Category:** Ansible Project\
**Created:** [November 10, 2017, 5:40pm UTC](https://forum.ansible.com/t/when-installing-ansible-from-source-how-can-i-make-setup-py-install-to-a-certain-directory-instead-of-the-build-directory/25996 "2017-11-10T17:40:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [November 10, 2017, 5:40pm UTC](https://forum.ansible.com/t/when-installing-ansible-from-source-how-can-i-make-setup-py-install-to-a-certain-directory-instead-of-the-build-directory/25996/1 "2017-11-10T17:40:15Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [November 10, 2017, 5:54pm UTC](https://forum.ansible.com/t/when-installing-ansible-from-source-how-can-i-make-setup-py-install-to-a-certain-directory-instead-of-the-build-directory/25996/2 "2017-11-10T17:54:50Z")

</div>

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`
