# ansible 2.2.1.0 and Jinja2 2.9.5

**URL:** <https://forum.ansible.com/t/ansible-2-2-1-0-and-jinja2-2-9-5/24021>\
**Category:** Ansible Project\
**Created:** [March 21, 2017, 10:47am UTC](https://forum.ansible.com/t/ansible-2-2-1-0-and-jinja2-2-9-5/24021 "2017-03-21T10:47:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [March 21, 2017, 10:47am UTC](https://forum.ansible.com/t/ansible-2-2-1-0-and-jinja2-2-9-5/24021/1 "2017-03-21T10:47:23Z")

</div>

HI!

When invoking ansible 2.2.1.0 with Python module Jinja2 2.9.5 installed it fails with:

ERROR! Unexpected Exception: The 'jinja2\<2.9' distribution was not found and is required  
by ansible

Are there really serious interop issues with Jinja 2.9.x+?

I'm asking because this blocks OS package updates for Jinja.

Ciao, Michael.

---

<div class="post-metadata">

**Author:** ![Alan\_Orth](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Alan\_Orth](https://forum.ansible.com/u/Alan_Orth)\
**Post date:** [March 25, 2017, 9:13pm UTC](https://forum.ansible.com/t/ansible-2-2-1-0-and-jinja2-2-9-5/24021/2 "2017-03-25T21:13:07Z")

</div>

Yeah, definitely issues between those two. See some issue reports on  
GitHub, for example:

[https://github.com/ansible/ansible/issues/20063](https://github.com/ansible/ansible/issues/20063)

Regarads,

---

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [May 25, 2017, 11:37am UTC](https://forum.ansible.com/t/ansible-2-2-1-0-and-jinja2-2-9-5/24021/3 "2017-05-25T11:37:12Z")

</div>

Alan Orth wrote:

> Yeah, definitely issues between those two. See some issue reports on  
> GitHub, for example:
> 
> [https://github.com/ansible/ansible/issues/20063](https://github.com/ansible/ansible/issues/20063)

Any news on that?

The bug above is labeled "affects\_2.3" and there's no milestone defined yet.

I'm asking because the Linux distros ship with Jinja2 2.9.x and therefore their ansible  
packages won't work.

Personally I'm using a virtualenv for ansible installation because of that. But what's  
the general recommendation?

Ciao, Michael.

---

<div class="post-metadata">

**Author:** ![Mirko\_Friedenhagen](https://avatars.discourse-cdn.com/v4/letter/m/838e76/32.png) [@Mirko\_Friedenhagen](https://forum.ansible.com/u/Mirko_Friedenhagen)\
**Post date:** [May 25, 2017, 6:50pm UTC](https://forum.ansible.com/t/ansible-2-2-1-0-and-jinja2-2-9-5/24021/4 "2017-05-25T18:50:42Z")

</div>

Hello Michael,

I would always recommend to take the virtualenv approach for non-trivial python software. The same principle is used for e.g. WARs or take a look at docker-compose, they even bundle Python itself. Wasting 30MB disk space is nothing compared to the effort needed to align every Python software on an OS in regards of their dependencies.

Regards  
Mirko

---

<div class="post-metadata">

**Author:** ![Michael\_Stroder](https://avatars.discourse-cdn.com/v4/letter/m/7ea924/32.png) [@Michael\_Stroder](https://forum.ansible.com/u/Michael_Stroder)\
**Post date:** [May 25, 2017, 8:51pm UTC](https://forum.ansible.com/t/ansible-2-2-1-0-and-jinja2-2-9-5/24021/5 "2017-05-25T20:51:25Z")

</div>

Mirko Friedenhagen wrote:

> I would always recommend to take the virtualenv approach for non-trivial python  
> software.

In this particular case it's not a matter of whether to use virtualenv or not or whether  
disk space is wasted. The real issue is the need for version pinning which eventually  
leads to missing important security updates.

> The same principle is used for e.g. WARs or take a look at docker-compose, they even  
> bundle Python itself. Wasting 30MB disk space is nothing compared to the effort needed  
> to align every Python software on an OS in regards of their dependencies.

Yes, but same issues with how to install security updates there.

Ciao, Michael.
