# How to change the python path of the target machine when running ansible?

**URL:** <https://forum.ansible.com/t/how-to-change-the-python-path-of-the-target-machine-when-running-ansible/20111>\
**Category:** Ansible Project\
**Created:** [January 3, 2016, 8:40pm UTC](https://forum.ansible.com/t/how-to-change-the-python-path-of-the-target-machine-when-running-ansible/20111 "2016-01-03T20:40:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sivaram\_Kannan](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@Sivaram\_Kannan](https://forum.ansible.com/u/Sivaram_Kannan)\
**Post date:** [January 3, 2016, 8:40pm UTC](https://forum.ansible.com/t/how-to-change-the-python-path-of-the-target-machine-when-running-ansible/20111/1 "2016-01-03T20:40:12Z")

</div>

Hi,

I am testing ansible in CoreOS. I kind of set it up with pypy and it works. When I run a ping of a remote machine “ansible all -m ping” - I am getting the below error.

msg": “/bin/sh: /usr/bin/python: No such file or directory\r\nOpenSSH\_6.9p1, OpenSSL 1.0.2e 3 Dec 2015\r\ndebug1: Reading configuration data /etc/ssh/ssh\_config\r\ndebug1: auto-mux: Trying existing master\r\ndebug1: mux\_client\_request\_session: master session id: 2\r\nShared connection to 17.1.1.1 closed.\r\n”

The python path is in /opt/bin/python( this is pypy link ). Is there any way I can specify python path while running ansible?

Thanks,  
./Siva.

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [January 4, 2016, 3:25pm UTC](https://forum.ansible.com/t/how-to-change-the-python-path-of-the-target-machine-when-running-ansible/20111/2 "2016-01-04T15:25:59Z")

</div>

You will need to set the ansible\_python\_interpreter for those hosts pointing to the correct python binary. See the following FAQ for more info:

[http://docs.ansible.com/ansible/faq.html#how-do-i-handle-python-pathing-not-having-a-python-2-x-in-usr-bin-python-on-a-remote-machine](http://docs.ansible.com/ansible/faq.html#how-do-i-handle-python-pathing-not-having-a-python-2-x-in-usr-bin-python-on-a-remote-machine)
