# Ansible Install on OS X

**URL:** <https://forum.ansible.com/t/ansible-install-on-os-x/16113>\
**Category:** Ansible Project\
**Created:** [September 4, 2014, 2:41pm UTC](https://forum.ansible.com/t/ansible-install-on-os-x/16113 "2014-09-04T14:41:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Hughes](https://avatars.discourse-cdn.com/v4/letter/m/f04885/32.png) [@Matt\_Hughes](https://forum.ansible.com/u/Matt_Hughes)\
**Post date:** [September 4, 2014, 2:41pm UTC](https://forum.ansible.com/t/ansible-install-on-os-x/16113/1 "2014-09-04T14:41:43Z")

</div>

I started out trying to use Ansible via Home Brew, but I needed to add a pip library (docker-py) and read that even Brew’s ansible uses the systems python. So I removed python and ansible completely from brew.

I then tried to install Ansible via the system pip. Now I get ‘bad interpreter’ errors:

› brew list  
ack brew-cask git-annex jq macvim pcre sysdig watch  
ant cmake gmp jruby md5sha1sum pkg-config the\_silver\_searcher wget  
apple-gcc42 cscope gnupg jsonpp nettle readline tig xmlstarlet  
autojump curl gnutls libevent node reattach-to-user-namespace tmux xz  
bash gdbm go libidn openssl rlwrap tree zsh-completions  
bash-completion gettext grc libtasn1 panamax scala vimpager zsh-history-substring-search  
bison git gsasl libyaml pandoc sqlite wakeonlan zsh-syntax-highlighting

in ansible/centos/  
› which python  
/usr/bin/python

in ansible/centos/  
› which ansible  
/usr/local/bin/ansible

in ansible/centos/  
› ls -lh /usr/local/bin/ansible  
-rwxr-xr-x 1 root admin 7.9K Sep 3 21:39 /usr/local/bin/ansible

in ansible/centos/  
› ls -lh /usr/local/bin/ansible-playbook  
-rwxr-xr-x 1 root admin 12K Sep 3 21:39 /usr/local/bin/ansible-playbook

in ansible/centos/  
› ansible-playbook  
zsh: /usr/local/bin/ansible-playbook: bad interpreter: /usr/local/opt/python/bin/python2.7: no such file or directory

in ansible/centos/  
› ansible  
zsh: /usr/local/bin/ansible: bad interpreter: /usr/local/opt/python/bin/python2.7: no such file or directory

Any tips to either rescue my system install or make Brew’s Ansible use Brew’s pip library would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [September 4, 2014, 2:54pm UTC](https://forum.ansible.com/t/ansible-install-on-os-x/16113/2 "2014-09-04T14:54:13Z")

</div>

(replying to thread this time)

_/bin/ansible-_ uses “/usr/bin/env” to launch whatever python is in your path, which is pretty standard practice.

It seems like you might have /usr/bin/python symlinked to something that is a broken symlink or is not marked executable.

pip install on OS X is a fine way to do things.

We don’t recommend homebrew because they have applied patches not in the main ansible tree, and have not contributed them back upstream, which makes it confusing when people report having installed from brew.

Another super easy way to run from OS X is to just do a checkout and:

source ./hacking/env-setup

Ansible runs very easy from source once deps are available.
