# Loading custom jinja2 filters use system python instead of ansible\_python\_interpreter in 1.6.2

**URL:** <https://forum.ansible.com/t/loading-custom-jinja2-filters-use-system-python-instead-of-ansible-python-interpreter-in-1-6-2/15380>\
**Category:** Ansible Developer\
**Created:** [May 30, 2014, 7:07pm UTC](https://forum.ansible.com/t/loading-custom-jinja2-filters-use-system-python-instead-of-ansible-python-interpreter-in-1-6-2/15380 "2014-05-30T19:07:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lars\_Vonk](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@Lars\_Vonk](https://forum.ansible.com/u/Lars_Vonk)\
**Post date:** [May 30, 2014, 7:07pm UTC](https://forum.ansible.com/t/loading-custom-jinja2-filters-use-system-python-instead-of-ansible-python-interpreter-in-1-6-2/15380/1 "2014-05-30T19:07:16Z")

</div>

Hi,

I just upgraded Ansible from 1.4 → 1.6.2 and noticed that one of our custom jinja 2 plugins configured in filter\_plugins/custom\_plugins.py no longer works since a used module is not in the system python. The plugin provided a vault functionality because at that time it was not available in Ansible yet. The code:

filter\_plugins/custom\_plugins.py

import os.path  
from ansible import errors

try:

from keyczar import keyczar

def vault(encrypted):  
keydir = os.path.expanduser(‘~/.mykeystore’)  
crypter = keyczar.Crypter.Read(keydir)  
return crypter.Decrypt(encrypted)

except ImportError as e:  
raise errors.AnsibleFilterError(“|keyczar not loaded: %s” % e)

We could use it in tasks like this:

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [June 6, 2014, 11:57am UTC](https://forum.ansible.com/t/loading-custom-jinja2-filters-use-system-python-instead-of-ansible-python-interpreter-in-1-6-2/15380/2 "2014-06-06T11:57:11Z")

</div>

Ansible’s core code has never used ansible\_python\_interpreter for filter plugins, actually. They run under the process that launched ansible, not remotely, so this doesn’t really apply.

So you’ll have to make things installed where your current python you are executing ansible with can find it.

I suspect you might have tweaked the ansible shebang line on your copy, and the upgrade (correctly) put it back, and you might want to change it again or something?
