# ansible installation on Mac issue

**URL:** <https://forum.ansible.com/t/ansible-installation-on-mac-issue/38305>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [August 5, 2023, 8:09pm UTC](https://forum.ansible.com/t/ansible-installation-on-mac-issue/38305 "2023-08-05T20:09:00Z")\
**Posts on this page:** 3\
**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 5, 2023, 8:09pm UTC](https://forum.ansible.com/t/ansible-installation-on-mac-issue/38305/1 "2023-08-05T20:09:00Z")

</div>

hi all

I have an issue with the ansible installation on Mac.  
I was able to install ansible without issue on a Cloud9 ubuntu compute instance, EC2 instances, etc, but I am having a permissions issue on the Mac.

I have to run with sudo  
With sudo this is the ansibile --version

% sudo ansible --version  
Password:  
ansible [core 2.15.2]  
config file = None  
configured module search path = [‘/Users/xxxx/.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/xxxx/.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

I am logged into the Mac as user xxxx with administrator privileges.

when I run the ansible version without sudo I get the following backtrace. (I don’t know why it is referencing python 3.7. It initially installed with module location of 3.7 but that was fixed and from output above it has the 3.11 module location).

% 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’**

It seems to be an issue with this tmp directory:

**‘/Users/xxxx/.ansible/tmp/ansible-local-506222opmhr9x’**

**I tried getting into the this tmp directory and get permission denied as it is owned by root**

% ls -la

total 0

drwxr-xr-x 4 root staff 128 May 23 18:01 .

drwxr-xr-x+ 50 xxx staff 1600 Aug 3 18:08 …

drwx------ 2 root staff 64 May 23 18:02 cp

drwx------ 2 root staff 64 Aug 3 18:23 tmp

Is there a fix for this?

warm regards

Dave

---

<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:11pm UTC](https://forum.ansible.com/t/ansible-installation-on-mac-issue/38305/2 "2023-08-07T16:11:19Z")

</div>

You should not need to run ansible as root, nor should you have other  
administrative privileges for running it.  
Also the installation with pip should not need root/admin:  
Follow [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)

---

<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 7, 2023, 6:12pm UTC](https://forum.ansible.com/t/ansible-installation-on-mac-issue/38305/3 "2023-08-07T18:12:12Z")

</div>

Hi Dick

Thanks.

I had tried installing based on the docs last week and just tried again and see the below output.

**I think I need to uninstall the current installation so that I can do a clean install.**
