# Using 2 ansible versions

**URL:** <https://forum.ansible.com/t/using-2-ansible-versions/27419>\
**Category:** Ansible Project\
**Created:** [May 1, 2018, 10:29am UTC](https://forum.ansible.com/t/using-2-ansible-versions/27419 "2018-05-01T10:29:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Varun\_Chopra](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@Varun\_Chopra](https://forum.ansible.com/u/Varun_Chopra)\
**Post date:** [May 1, 2018, 10:29am UTC](https://forum.ansible.com/t/using-2-ansible-versions/27419/1 "2018-05-01T10:29:36Z")

</div>

Hi,

I’m trying to install Ansible 2.3 on a server with 2.5 already present.

I built and installed virtualenv and download ansible 2.3 and initiated a virtualenv using source ./hacking/env-setup

Will this new installation hinder with the 2.5 install in any way?

How long does the virtualenv exist? How do I close the virtualenv and go back to using 2.5?

---

<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:** [May 1, 2018, 11:02am UTC](https://forum.ansible.com/t/using-2-ansible-versions/27419/2 "2018-05-01T11:02:31Z")

</div>

There is a lot of guides about Python virtual environment that you can read to get this information.  
But I can give you this as an example

user@gh:~$ virtualenv ~/ansible2.3  
Running virtualenv with interpreter /usr/bin/python2  
New python executable in /home/user/ansible2.3/bin/python2  
Also creating executable in /home/user/ansible2.3/bin/python  
Installing setuptools, pkg\_resources, pip, wheel...done.

(ansible2.3) user@gh:~$ pip install "ansible\<2.4"  
Collecting ansible\<2.4  
&nbsp;&nbsp;&nbsp;Downloading [https://files.pythonhosted.org/packages/d4/61/4080493544ecec71e770a20aa94cbd35a382813fac4fddb97573ae50bc7d/ansible-2.3.3.0.tar.gz](https://files.pythonhosted.org/packages/d4/61/4080493544ecec71e770a20aa94cbd35a382813fac4fddb97573ae50bc7d/ansible-2.3.3.0.tar.gz) (4.2MB)  
\<snip /\>  
Successfully built ansible PyYAML pycrypto MarkupSafe pycparser  
Installing collected packages: MarkupSafe, jinja2, PyYAML, pycparser, cffi, enum34, idna, asn1crypto, six, ipaddress, cryptography, pynacl, pyasn1, bcrypt, paramiko, pycrypto, ansible  
Successfully installed MarkupSafe-1.0 PyYAML-3.12 ansible-2.3.3.0 asn1crypto-0.24.0 bcrypt-3.1.4 cffi-1.11.5 cryptography-2.2.2 enum34-1.1.6 idna-2.6 ipaddress-1.0.22 jinja2-2.10 paramiko-2.4.1 pyasn1-0.4.2 pycparser-2.18 pycrypto-2.6.1 pynacl-1.2.1 six-1.11.0

(ansible2.3) user@gh:~$ ansible --version  
ansible 2.3.3.0  
&nbsp;&nbsp;&nbsp;config file = /etc/ansible/ansible.cfg  
&nbsp;&nbsp;&nbsp;configured module search path = Default w/o overrides  
&nbsp;&nbsp;&nbsp;python version = 2.7.14 (default, Sep 23 2017, 22:06:14) [GCC 7.2.0]

(ansible2.3) user@gh:~$ deactivate

user@gh:~$ ansible --version  
ansible 2.5.2  
&nbsp;&nbsp;&nbsp;config file = /etc/ansible/ansible.cfg  
&nbsp;&nbsp;&nbsp;configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']  
&nbsp;&nbsp;&nbsp;ansible python module location = /usr/lib/python2.7/dist-packages/ansible  
&nbsp;&nbsp;&nbsp;executable location = /usr/bin/ansible  
&nbsp;&nbsp;&nbsp;python version = 2.7.14 (default, Sep 23 2017, 22:06:14) [GCC 7.2.0]

user@gh:~$ source ~/ansible2.3/bin/activate

(ansible2.3) user@gh:~$ ansible --version  
ansible 2.3.3.0  
&nbsp;&nbsp;&nbsp;config file = /etc/ansible/ansible.cfg  
&nbsp;&nbsp;&nbsp;configured module search path = Default w/o overrides  
&nbsp;&nbsp;&nbsp;python version = 2.7.14 (default, Sep 23 2017, 22:06:14) [GCC 7.2.0]

---

<div class="post-metadata">

**Author:** ![Varun\_Chopra](https://avatars.discourse-cdn.com/v4/letter/v/54ee81/32.png) [@Varun\_Chopra](https://forum.ansible.com/u/Varun_Chopra)\
**Post date:** [May 1, 2018, 11:42am UTC](https://forum.ansible.com/t/using-2-ansible-versions/27419/3 "2018-05-01T11:42:38Z")

</div>

Thanks man. Wasn’t sure if i should run ansible from source or install it in the virtualenv using pip.
