# How to set Python interpreter?

**URL:** <https://forum.ansible.com/t/how-to-set-python-interpreter/33749>\
**Category:** Ansible Project\
**Created:** [September 5, 2020, 5:08pm UTC](https://forum.ansible.com/t/how-to-set-python-interpreter/33749 "2020-09-05T17:08:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [September 5, 2020, 5:08pm UTC](https://forum.ansible.com/t/how-to-set-python-interpreter/33749/1 "2020-09-05T17:08:17Z")

</div>

I get warning when I execute an ansible command, for example. (Macbook Pro)

$ ansible --version

/Library/Python/2.7/site-packages/cryptography/ **init**.py:39: CryptographyDeprecationWarning: Python 2 is no longer supported by the Python core team. Support for it is now deprecated in cryptography, and will be removed in a future release.

CryptographyDeprecationWarning,

ansible 2.9.13

config file = /Users/cfouts/.ansible.cfg

configured module search path = [u’/Path/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]

ansible python module location = /Path/Library/Python/2.7/lib/python/site-packages/ansible

executable location = /usr/local/bin/ansible

python version = 2.7.16 (default, Jun 5 2020, 22:59:21) [GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc-

Do I just set up the

ansible\_python\_interpreter = ???

in my config file for a different python library?

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [September 5, 2020, 6:16pm UTC](https://forum.ansible.com/t/how-to-set-python-interpreter/33749/2 "2020-09-05T18:16:19Z")

</div>

How did you install ansible ?

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [September 5, 2020, 6:47pm UTC](https://forum.ansible.com/t/how-to-set-python-interpreter/33749/3 "2020-09-05T18:47:13Z")

</div>

Thank you. That made me realize I did

$ pip install ansible

But once I did

$ pip3 install ansible

it’s all fixed.

Chris

---

<div class="post-metadata">

**Author:** ![Prasad\_Shetty](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/prasad_shetty/32/4913_2.png) [@Prasad\_Shetty](https://forum.ansible.com/u/Prasad_Shetty)\
**Post date:** [September 6, 2020, 4:03am UTC](https://forum.ansible.com/t/how-to-set-python-interpreter/33749/4 "2020-09-06T04:03:11Z")

</div>

May be you can use something like this.

ansible\_python\_interpreter: /usr/libexec/platform-python

ansible\_python\_interpreter: ‘{{ ansible\_playbook\_python }}’

Regards  
Prasad

---

<div class="post-metadata">

**Author:** ![ZillaYT](https://avatars.discourse-cdn.com/v4/letter/z/4da419/32.png) [@ZillaYT](https://forum.ansible.com/u/ZillaYT)\
**Post date:** [September 6, 2020, 4:51pm UTC](https://forum.ansible.com/t/how-to-set-python-interpreter/33749/5 "2020-09-06T16:51:05Z")

</div>

Installing ansible with pip3 did the trick.
