# installing ansible in isolated virtual env

**URL:** <https://forum.ansible.com/t/installing-ansible-in-isolated-virtual-env/33196>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [June 16, 2020, 1:58pm UTC](https://forum.ansible.com/t/installing-ansible-in-isolated-virtual-env/33196 "2020-06-16T13:58:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [June 16, 2020, 1:58pm UTC](https://forum.ansible.com/t/installing-ansible-in-isolated-virtual-env/33196/1 "2020-06-16T13:58:38Z")

</div>

Is there a way to install ansible on osX in an isolated virtual environment? without having to setup a ubuntu VM?

I dont want the ansible binaries or whatever software it installs on osx to interfere with my working environment

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [June 16, 2020, 2:17pm UTC](https://forum.ansible.com/t/installing-ansible-in-isolated-virtual-env/33196/2 "2020-06-16T14:17:28Z")

</div>

python3 -m venv venv  
source venv/bin/activate  
pip install ansible

ansible --version  
ansible 2.9.9  
&nbsp;&nbsp;config file = /Users/dnmvisser/.ansible.cfg  
&nbsp;&nbsp;configured module search path =  
['/Users/dnmvisser/.ansible/plugins/modules',  
'/usr/share/ansible/plugins/modules']  
&nbsp;&nbsp;ansible python module location =  
/Users/dnmvisser/venv/lib/python3.7/site-packages/ansible  
&nbsp;&nbsp;executable location = /Users/dnmvisser/venv/bin/ansible  
&nbsp;&nbsp;python version = 3.7.3 (default, Sep 5 2019, 17:14:41) [Clang  
11.0.0 (clang-1100.0.33.8)]

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [June 16, 2020, 2:36pm UTC](https://forum.ansible.com/t/installing-ansible-in-isolated-virtual-env/33196/3 "2020-06-16T14:36:51Z")

</div>

Thanks

but i got this

NAR33051M:Resources twong$ sudo python3 -m venv venv  
Password:  
Error: [Errno 1] Operation not permitted: ‘/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/venv’  
pyenv: no such command `sh-activate’  
NAR33051M:Resources twong$

---

<div class="post-metadata">

**Author:** ![Antony\_Stone](https://avatars.discourse-cdn.com/v4/letter/a/4491bb/32.png) [@Antony\_Stone](https://forum.ansible.com/u/Antony_Stone)\
**Post date:** [June 16, 2020, 3:04pm UTC](https://forum.ansible.com/t/installing-ansible-in-isolated-virtual-env/33196/4 "2020-06-16T15:04:26Z")

</div>

> NAR33051M:Resources twong$ sudo python3 -m venv venv  
> Password:  
> Error: [Errno 1] Operation not permitted:  
> '/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resour  
> ces/venv' pyenv: no such command `sh-activate'

Did you try it as written - without the "sudo"?

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [June 16, 2020, 3:07pm UTC](https://forum.ansible.com/t/installing-ansible-in-isolated-virtual-env/33196/5 "2020-06-16T15:07:56Z")

</div>

ok fixed the issue.

---

<div class="post-metadata">

**Author:** ![Tony\_Wong](https://avatars.discourse-cdn.com/v4/letter/t/3ab097/32.png) [@Tony\_Wong](https://forum.ansible.com/u/Tony_Wong)\
**Post date:** [June 16, 2020, 3:16pm UTC](https://forum.ansible.com/t/installing-ansible-in-isolated-virtual-env/33196/6 "2020-06-16T15:16:04Z")

</div>

where is the venv stored? how do I remove it?

how do i enter the environment?

like this everytime I open a terminal?

source venv/bin/activate

how do i list what venv insgtalled and how do I remove

how do i exit?

when i try to. exit its stuck on this

(venv) NAR33051M:~ twong$ venv  
-bash: venv: command not found  
(venv) NAR33051M:~ twong$ virtualenv  
-bash: virtualenv: command not found  
(venv) NAR33051M:~ twong$ ansible  
(venv) NAR33051M:~ twong$ exit  
logout  
Saving session…  
…copying shared history…  
…saving history…truncating history files…  
…completed.

[Process completed]

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [June 17, 2020, 4:55am UTC](https://forum.ansible.com/t/installing-ansible-in-isolated-virtual-env/33196/7 "2020-06-17T04:55:41Z")

</div>

This is a support list for problems related to ansible, not for basic system administration help.

Instead of copy pasting commands please do a little bit of effort yourself and at least try to understand what they mean.  
If you spend one minute on google you will find the answers to all your questions. Please also do that before posting future questions here.

One advice for now, if you do copy paste commands without knowing what they mean, certainly not use sudo.
