# ANSIBLE - Venv - Use /usr/bin/ansible

**URL:** <https://forum.ansible.com/t/ansible-venv-use-usr-bin-ansible/37463>\
**Category:** Ansible Project\
**Created:** [December 13, 2022, 4:09pm UTC](https://forum.ansible.com/t/ansible-venv-use-usr-bin-ansible/37463 "2022-12-13T16:09:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![julien\_mahieu](https://avatars.discourse-cdn.com/v4/letter/j/ec9cab/32.png) [@julien\_mahieu](https://forum.ansible.com/u/julien_mahieu)\
**Post date:** [December 13, 2022, 4:09pm UTC](https://forum.ansible.com/t/ansible-venv-use-usr-bin-ansible/37463/1 "2022-12-13T16:09:31Z")

</div>

Hi experts,

In order to manage network devices, I’m currently setting up an environment with ansible inside a python venv on a linux Alma 8 platform.

Below, the steps I used to install the components :

**# Venv creation**  
[MyUser@MyAnsibleVm ~]$python3 -m venv ansible4.10  
[MyUser@MyAnsibleVm ~]$source ansible4.10/bin/activate

**# pip installation / upgrade**  
(ansible4.10) [MyUser@MyAnsibleVm ~]$python3 -m ensurepip --default-pip  
(ansible4.10) [MyUser@MyAnsibleVm ~]$python3 -m pip install --upgrade pip

**# Ansible installation**  
(ansible4.10) [MyUser@MyAnsibleVm ~]$python3 -m pip install ansible

At the end we have ansible installed correctly. All the steps seems to be good.  
**# List packages**  
(ansible4.10) [MyUser@MyAnsibleVm ~]$ python3 -m pip list  
Package Version

* * *

**ansible 4.10.0**  
**ansible-core 2.11.12**  
cffi 1.15.1  
cryptography 38.0.3  
Jinja2 3.0.3  
…

Unfortunately, if I check the ansible version inside my venv, I still have my old global ansible version, rather than the new venv version :

(ansible4.10) [MyUser@MyAnsibleVm ~]$ ansible --version  
**ansible 2.9.10**  
config file = /etc/ansible/ansible.cfg  
configured module search path = [‘/home/MyUser/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]  
ansible python module location = /usr/lib/python3.6/site-packages/ansible  
executable location = /usr/bin/ansible

python version = 3.6.8 (default, May 24 2021, 08:40:28) [GCC 8.4.1 20200928 (Red Hat 8.4.1-1)]

Any ideas to help ?

Thank you

Ju

---

<div class="post-metadata">

**Author:** ![julien\_mahieu](https://avatars.discourse-cdn.com/v4/letter/j/ec9cab/32.png) [@julien\_mahieu](https://forum.ansible.com/u/julien_mahieu)\
**Post date:** [December 16, 2022, 4:00pm UTC](https://forum.ansible.com/t/ansible-venv-use-usr-bin-ansible/37463/2 "2022-12-16T16:00:14Z")

</div>

Finally, the problem was related to security restrictions on the partition where my venv was located.

It works perfectly on another mounting point.

Ju
