# Could we read the ansible\_python\_interpreter from an environment variable?

**URL:** <https://forum.ansible.com/t/could-we-read-the-ansible-python-interpreter-from-an-environment-variable/14422>\
**Category:** Ansible Developer\
**Created:** [January 25, 2014, 12:02am UTC](https://forum.ansible.com/t/could-we-read-the-ansible-python-interpreter-from-an-environment-variable/14422 "2014-01-25T00:02:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joshua\_Conner](https://avatars.discourse-cdn.com/v4/letter/j/8c91f0/32.png) [@Joshua\_Conner](https://forum.ansible.com/u/Joshua_Conner)\
**Post date:** [January 25, 2014, 12:02am UTC](https://forum.ansible.com/t/could-we-read-the-ansible-python-interpreter-from-an-environment-variable/14422/1 "2014-01-25T00:02:38Z")

</div>

You can set the ansible\_python\_interpreter for a host in the inventory file, but it would be nice if I it would read this in from an $ANSIBLE\_PYTHON\_INTERPRETER environment variable. I use homebrew-ed Python on my local machine, and I’d love to just add a line to my dotfiles instead of having to add

[local]  
localhost ansible\_python\_interpreter=/usr/local/bin/python

to an inventory file for each playbook. Is there another way I should be doing this? Does anyone else have any thoughts? If it seems like a good idea I’d be happy to try and put something together.

Thanks!  
Josh Conner

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [January 25, 2014, 12:05am UTC](https://forum.ansible.com/t/could-we-read-the-ansible-python-interpreter-from-an-environment-variable/14422/2 "2014-01-25T00:05:05Z")

</div>

It wouldn’t make a lot of sense as an environment variable because it’s designed to differ on a server by server basis.

You definitely don’t have to have a different inventory for each playbook either, just pass the same inventory in with -i.
