# ansible python issue

**URL:** <https://forum.ansible.com/t/ansible-python-issue/35865>\
**Category:** Ansible Project\
**Tags:** kubernetes, galaxy-ng\
**Created:** [October 14, 2021, 2:21am UTC](https://forum.ansible.com/t/ansible-python-issue/35865 "2021-10-14T02:21:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marlon\_Frank](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Marlon\_Frank](https://forum.ansible.com/u/Marlon_Frank)\
**Post date:** [October 14, 2021, 2:21am UTC](https://forum.ansible.com/t/ansible-python-issue/35865/1 "2021-10-14T02:21:33Z")

</div>

hi team,  
I’ve recently logged an issue on githut however it was close by with clear direction on what to do other than saying install kubernetes client python…  
that was already installed as described by me on that occasion…  
any other pointers that could help?  
I am losing hope here… I do have several other modules installed and working just fine it is just the kubernetes module that seems to not work for me…  
more details here…  
[https://github.com/ansible/ansible/issues/76022](https://github.com/ansible/ansible/issues/76022)

and below as I can confirm that I already have it installed

marlon@ansible:~$ sudo pip install kubernetes  
[sudo] password for marlon:  
Requirement already satisfied: kubernetes in /usr/local/lib/python3.8/dist-packages (8.0.2)  
Requirement already satisfied: setuptools\>=21.0.0 in /usr/local/lib/python3.8/dist-packages (from kubernetes) (58.2.0)  
Requirement already satisfied: google-auth\>=1.0.1 in /usr/local/lib/python3.8/dist-packages (from kubernetes) (2.3.0)  
Requirement already satisfied: adal\>=1.0.2 in /usr/local/lib/python3.8/dist-packages (from kubernetes) (1.2.7)  
Requirement already satisfied: urllib3\>=1.24.2 in /usr/local/lib/python3.8/dist-packages (from kubernetes) (1.26.7)  
Requirement already satisfied: pyyaml\>=3.12 in /usr/local/lib/python3.8/dist-packages (from kubernetes) (5.4.1)  
Requirement already satisfied: requests in /usr/local/lib/python3.8/dist-packages (from kubernetes) (2.26.0)  
Requirement already satisfied: six\>=1.9.0 in /usr/local/lib/python3.8/dist-packages (from kubernetes) (1.16.0)  
Requirement already satisfied: certifi\>=14.05.14 in /usr/local/lib/python3.8/dist-packages (from kubernetes) (2021.10.8)  
Requirement already satisfied: requests-oauthlib in /usr/local/lib/python3.8/dist-packages (from kubernetes) (1.3.0)  
Requirement already satisfied: python-dateutil\>=2.5.3 in /usr/local/lib/python3.8/dist-packages (from kubernetes) (2.8.2)  
Requirement already satisfied: websocket-client!=0.40.0,!=0.41._,!=0.42._,\>=0.32.0 in /usr/local/lib/python3.8/dist-packages (from kubernetes) (1.2.1)  
Requirement already satisfied: rsa\<5,\>=3.1.4 in /usr/local/lib/python3.8/dist-packages (from google-auth\>=1.0.1-\>kubernetes) (4.7.2)  
Requirement already satisfied: cachetools\<5.0,\>=2.0.0 in /usr/local/lib/python3.8/dist-packages (from google-auth\>=1.0.1-\>kubernetes) (4.2.4)  
Requirement already satisfied: pyasn1-modules\>=0.2.1 in /usr/local/lib/python3.8/dist-packages (from google-auth\>=1.0.1-\>kubernetes) (0.2.8)  
Requirement already satisfied: cryptography\>=1.1.0 in /usr/local/lib/python3.8/dist-packages (from adal\>=1.0.2-\>kubernetes) (35.0.0)  
Requirement already satisfied: PyJWT\<3,\>=1.0.0 in /usr/local/lib/python3.8/dist-packages (from adal\>=1.0.2-\>kubernetes) (2.2.0)  
Requirement already satisfied: idna\<4,\>=2.5; python\_version \>= “3” in /usr/local/lib/python3.8/dist-packages (from requests-\>kubernetes) (3.2)  
Requirement already satisfied: charset-normalizer~=2.0.0; python\_version \>= “3” in /usr/local/lib/python3.8/dist-packages (from requests-\>kubernetes) (2.0.7)  
Requirement already satisfied: oauthlib\>=3.0.0 in /usr/local/lib/python3.8/dist-packages (from requests-oauthlib-\>kubernetes) (3.1.1)  
Requirement already satisfied: pyasn1\>=0.1.3 in /usr/local/lib/python3.8/dist-packages (from rsa\<5,\>=3.1.4-\>google-auth\>=1.0.1-\>kubernetes) (0.4.8)  
Requirement already satisfied: cffi\>=1.12 in /usr/local/lib/python3.8/dist-packages (from cryptography\>=1.1.0-\>adal\>=1.0.2-\>kubernetes) (1.14.6)  
Requirement already satisfied: pycparser in /usr/local/lib/python3.8/dist-packages (from cffi\>=1.12-\>cryptography\>=1.1.0-\>adal\>=1.0.2-\>kubernetes) (2.20)  
marlon@ansible:~$ sudo ansible-galaxy collection install kubernetes.core  
Starting galaxy collection install process  
Process install dependency map  
Starting collection install process  
Downloading [https://galaxy.ansible.com/download/kubernetes-core-2.2.0.tar.gz](https://galaxy.ansible.com/download/kubernetes-core-2.2.0.tar.gz) to /root/.ansible/tmp/ansible-local-750klau04v6/tmpzha4qz6v/kubernetes-core-2.2.0-3gkt2qxk  
Installing ‘kubernetes.core:2.2.0’ to ‘/root/.ansible/collections/ansible\_collections/kubernetes/core’  
kubernetes.core:2.2.0 was installed successfully  
marlon@ansible:~$ sudo ansible-galaxy collection install community.kubernetes  
Starting galaxy collection install process  
Process install dependency map  
Starting collection install process  
Downloading [https://galaxy.ansible.com/download/community-kubernetes-2.0.0.tar.gz](https://galaxy.ansible.com/download/community-kubernetes-2.0.0.tar.gz) to /root/.ansible/tmp/ansible-local-768144b2u\_w/tmp3p0zh0\_e/community-kubernetes-2.0.0-qe0hy7yf  
Installing ‘community.kubernetes:2.0.0’ to ‘/root/.ansible/collections/ansible\_collections/community/kubernetes’  
community.kubernetes:2.0.0 was installed successfully  
Skipping ‘kubernetes.core:2.2.0’ as it is already installed

thank you

---

<div class="post-metadata">

**Author:** ![dulhaver](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/dulhaver/32/1061_2.png) [@dulhaver](https://forum.ansible.com/u/dulhaver)\
**Post date:** [October 14, 2021, 9:15am UTC](https://forum.ansible.com/t/ansible-python-issue/35865/2 "2021-10-14T09:15:33Z")

</div>

I am running a [playbook to install postgresql](https://paste.debian.net/1215359/) against a centos7 (python 2.75) target and am getting this [error about a bad python interpreter](https://paste.debian.net/1215357/).

I try to solve this via the inventory.yml

all:  
hosts:  
[hostname]: # centos7  
ansible\_host: [VM-51150-0179.step.zrz.dvz.cn-mv.de](http://VM-51150-0179.step.zrz.dvz.cn-mv.de)  
ansible\_user: username  
ansible\_python\_interpreter: /usr/bin/python

(also tried interpreter\_python: /usr/bin/python). the error remains though

funny fact … I ran opther playbooks successfully against the same host even without have specified any python interpreter.

any ideas what may be going wrong here?
