# Error while installing ansible in OS X.

**URL:** <https://forum.ansible.com/t/error-while-installing-ansible-in-os-x/22333>\
**Category:** Ansible Project\
**Created:** [August 20, 2016, 9:34am UTC](https://forum.ansible.com/t/error-while-installing-ansible-in-os-x/22333 "2016-08-20T09:34:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramesh](https://avatars.discourse-cdn.com/v4/letter/r/d07c76/32.png) [@Ramesh](https://forum.ansible.com/u/Ramesh)\
**Post date:** [August 20, 2016, 9:34am UTC](https://forum.ansible.com/t/error-while-installing-ansible-in-os-x/22333/1 "2016-08-20T09:34:22Z")

</div>

Hi,

Im getting the below error while installing the —ansible in OS X. Help me on fixing this pls.

```auto

Rameshs-MacBook-Pro:centos-6.7 Ramesh$ sudo easy_install pip
Password:
Searching for pip
Best match: pip 8.1.2
Processing pip-8.1.2-py2.7.egg
pip 8.1.2 is already the active version in easy-install.pth
Installing pip script to /usr/local/bin
Installing pip2.7 script to /usr/local/bin
Installing pip2 script to /usr/local/bin

Using /Library/Python/2.7/site-packages/pip-8.1.2-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
Rameshs-MacBook-Pro:centos-6.7 Ramesh$ sudo pip install ansible --quiet
Command "/usr/bin/python -u -c "import setuptools, tokenize; __file__ ='/private/tmp/pip-build-zE90eG/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)( __file__ ).read().replace('\r\n', '\n'), __file__ , 'exec'))" install --record /tmp/pip-4nV8nv-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-zE90eG/pycrypto/

Rameshs-MacBook-Pro:centos-6.7 Ramesh$ vagrant provision
==> default: Running provisioner: ansible...
    default: Running ansible-playbook...
Traceback (most recent call last):
  File "/usr/local/bin/ansible-playbook", line 4, in <module>
    import pkg_resources
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2793, in <module>
    working_set.require( __requires__ )
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 673, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 576, in resolve
    raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: pycrypto>=2.6
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

```

---

<div class="post-metadata">

**Author:** ![pixel\_fairy](https://avatars.discourse-cdn.com/v4/letter/p/6f9a4e/32.png) [@pixel\_fairy](https://forum.ansible.com/u/pixel_fairy)\
**Post date:** [August 21, 2016, 7:56pm UTC](https://forum.ansible.com/t/error-while-installing-ansible-in-os-x/22333/2 "2016-08-21T19:56:50Z")

</div>

this should be a faq. I dont know the causes, but ansible wont install globally on os-x. you have to install as a user.

[https://gist.github.com/xahare/77ef7d3bb61f49df618ffa8bfb9142ad](https://gist.github.com/xahare/77ef7d3bb61f49df618ffa8bfb9142ad)

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [August 21, 2016, 8:07pm UTC](https://forum.ansible.com/t/error-while-installing-ansible-in-os-x/22333/3 "2016-08-21T20:07:19Z")

</div>

Or send a PR with updated installation instruction here  
[https://github.com/ansible/ansible/blob/devel/docsite/rst/intro\_installation.rst](https://github.com/ansible/ansible/blob/devel/docsite/rst/intro_installation.rst)
