# Trying to use ansible python module location as ansible python interpeter

**URL:** <https://forum.ansible.com/t/trying-to-use-ansible-python-module-location-as-ansible-python-interpeter/34261>\
**Category:** Ansible Project\
**Created:** [December 1, 2020, 8:35am UTC](https://forum.ansible.com/t/trying-to-use-ansible-python-module-location-as-ansible-python-interpeter/34261 "2020-12-01T08:35:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adar\_Shaked](https://avatars.discourse-cdn.com/v4/letter/a/b3f665/32.png) [@Adar\_Shaked](https://forum.ansible.com/u/Adar_Shaked)\
**Post date:** [December 1, 2020, 8:35am UTC](https://forum.ansible.com/t/trying-to-use-ansible-python-module-location-as-ansible-python-interpeter/34261/1 "2020-12-01T08:35:49Z")

</div>

Hi all,  
i am creating venv at runtime and installs ansible inside like:  
/tmp/tmp123/bin/ansible-playbook  
ansible version shows:  
ansible python module location =/tmp/tmp123/lib/python3.6/site-packages/ansible  
executable location = =/tmp/tmp123/bin/ansible-playbook

im running a playbook locally(means localhost) and i want the ansible python interpeter will be the one in the venv that i installed ansible inside. again , i know the loaction of the venv on runtime so i cant use `ansible_python_interpeter`. maybe there are environment variables that represent the ansible-playbook executable path that i can use in my playbook?or the python path of ansible executable uses ?

---

<div class="post-metadata">

**Author:** ![David\_Shrewsbury](https://avatars.discourse-cdn.com/v4/letter/d/aeb1de/32.png) [@David\_Shrewsbury](https://forum.ansible.com/u/David_Shrewsbury)\
**Post date:** [December 1, 2020, 12:04pm UTC](https://forum.ansible.com/t/trying-to-use-ansible-python-module-location-as-ansible-python-interpeter/34261/2 "2020-12-01T12:04:04Z")

</div>

ansible\_python\_interpreter: "{{ ansible\_playbook\_python }}"
