# help with ansible Mac installation

**URL:** <https://forum.ansible.com/t/help-with-ansible-mac-installation/38302>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [August 4, 2023, 7:49pm UTC](https://forum.ansible.com/t/help-with-ansible-mac-installation/38302 "2023-08-04T19:49:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmastrop](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dmastrop/32/362_2.png) [@dmastrop](https://forum.ansible.com/u/dmastrop)\
**Post date:** [August 4, 2023, 7:49pm UTC](https://forum.ansible.com/t/help-with-ansible-mac-installation/38302/1 "2023-08-04T19:49:40Z")

</div>

hi all,

I have installed ansible on Cloud9 and EC2 ubuntu instances but I am having trouble with the Mac installation.  
It might be because I installed it using  
sudo pip3 install ansible

when I should have used  
python3 -m pip install --user ansible ?

I tried running the python3 above but it stated everything is ok (and on python 3.11)

It was initially linked to an older version of python (3.7) but is now linked to the proper python module location.

However I cannot run anything without sudo privileges

**Here is the sudo ansible --version**

sudo ansible --version  
Password:  
ansible [core 2.15.2]  
config file = None  
configured module search path = [‘/Users/xxxxx/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ansible  
ansible collection location = /Users/xxxxx/.ansible/collections:/usr/share/ansible/collections  
executable location = /Library/Frameworks/Python.framework/Versions/3.11/bin/ansible  
python version = 3.11.4 (v3.11.4:d2340ef257, Jun 6 2023, 19:15:51) [Clang 13.0.0 (clang-1300.0.29.30)] (/Library/Frameworks/Python.framework/Versions/3.11/bin/python3.11)  
jinja version = 3.1.2  
libyaml = True

**Here is the ansible --version without sudo. (see bottom)**  
It is linking to the old python version in the traceback. Not sure why  
I tried getting into the tmp directory below as my local user on the Mac (with administrator privileges) but can’t get into it. It is owned by root.  
Both of the exceptions are related to this tmp directory permissions issue…

The tmp directory is  
Users/xxxx/.ansible/tmp/ansible-local-506222opmhr9x’

xxxx is my local user name (logged in user). I am administrator on the Mac.

_Does anyone know what I need to do to fix this permissions issue?_

warmest regards  
Dave

% ansible --version

**Unhandled error:**

Traceback (most recent call last):

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/config/manager.py”, line 605, in update\_config\_data

value, origin = self.get\_config\_value\_and\_origin(config, configfile)

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/config/manager.py”, line 543, in get\_config\_value\_and\_origin

value = ensure\_type(value, defs[config].get(‘type’), origin=origin)

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/config/manager.py”, line 124, in ensure\_type

value = tempfile.mkdtemp(prefix=prefix, dir=value)

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tempfile.py”, line 366, in mkdtemp

\_os.mkdir(file, 0o700)

**PermissionError: [Errno 13] Permission denied: ‘/Users/xxxx/.ansible/tmp/ansible-local-506222opmhr9x’**

Traceback (most recent call last):

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/config/manager.py”, line 605, in update\_config\_data

value, origin = self.get\_config\_value\_and\_origin(config, configfile)

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/config/manager.py”, line 543, in get\_config\_value\_and\_origin

value = ensure\_type(value, defs[config].get(‘type’), origin=origin)

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/config/manager.py”, line 124, in ensure\_type

value = tempfile.mkdtemp(prefix=prefix, dir=value)

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tempfile.py”, line 366, in mkdtemp

\_os.mkdir(file, 0o700)

**PermissionError: [Errno 13] Permission denied: '/Users/xxxx/.ansible/tmp/ansible-local-506222opmhr9x**’

**During handling of the above exception, another exception occurred:**

Traceback (most recent call last):

File “/Library/Frameworks/Python.framework/Versions/3.7/bin//ansible”, line 63, in

import ansible.constants as C

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/constants.py”, line 181, in

config = ConfigManager()

File “/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/config/manager.py”, line 310, in **init**

self.update\_config\_data()

File **“/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/ansible/config/manager.py”, line 617, in update\_config\_data**

**raise AnsibleError(“Invalid settings supplied for %s: %s\n” % (config, to\_native(e)), orig\_exc=e)**

**ansible.errors.AnsibleError: Invalid settings supplied for DEFAULT\_LOCAL\_TMP: [Errno 13] Permission denied: ‘/Users/xxxx/.ansible/tmp/ansible-local-506222opmhr9x’**

**. [Errno 13] Permission denied: ‘/Users/xxxx/.ansible/tmp/ansible-local-506222opmhr9x’**

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [August 7, 2023, 4:07pm UTC](https://forum.ansible.com/t/help-with-ansible-mac-installation/38302/2 "2023-08-07T16:07:53Z")

</div>

Hii,

I would recommend following the installation instructions from  
[https://docs.ansible.com/ansible/latest/installation\_guide/intro\_installation.html#installing-and-upgrading-ansible-with-pip](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-and-upgrading-ansible-with-pip)
