# Problem to install or detect if passlib module is installed

**URL:** <https://forum.ansible.com/t/problem-to-install-or-detect-if-passlib-module-is-installed/43202>\
**Category:** Get Help\
**Created:** [June 6, 2025, 7:42am UTC](https://forum.ansible.com/t/problem-to-install-or-detect-if-passlib-module-is-installed/43202 "2025-06-06T07:42:26Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![mcoussi](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/mcoussi/32/8056_2.png) [@mcoussi](https://forum.ansible.com/u/mcoussi)\
**Post date:** [June 6, 2025, 11:43am UTC](https://forum.ansible.com/t/problem-to-install-or-detect-if-passlib-module-is-installed/43202/3 "2025-06-06T11:43:40Z")

</div>

Hi @Lyle_McKarns,

Thanks for your reply.

I found this topic :

> [@Ansible python interpreter](https://forum.ansible.com/t/ansible-python-interpreter/8500/5):
>
> Hi. You can fix it by installing the “required python packages” in your venv with pip. --- - name: Install SQL scripts on Private PostgreSQL Instance hosts: localhost gather\_facts: true become: true tasks: - name: Install required python packages ansible.builtin.pip: name: - libpq-dev - python3-psycopg2 virtualenv: "{{ ansible\_facts['env']['VIRTUAL\_ENV'] }}" state: present The other option is to set the python interpreter to your OS pyt…

When i set the var [ansible\_python\_interpreter] in my playbook :

```auto
  vars:
     ansible_python_interpreter: "/usr/bin/python3"

```

The playbook works.

I found the difference between why it works on a DBServer and not working on other DBserver.  
It’s what you mentionned with [`/usr/bin/python3.12`]

On working DBServer, the python3.12 is not installed :

```auto
[root@OKDBSERVER check_mk]# ll /usr/bin/python3*
lrwxrwxrwx 1 root root 25 22 juin 2022 /usr/bin/python3 -> /etc/alternatives/python3
lrwxrwxrwx 1 root root 31 12 déc. 14:55 /usr/bin/python3.6 -> /usr/libexec/platform-python3.6
lrwxrwxrwx 1 root root 17 12 déc. 14:55 /usr/bin/python3.6-config -> python3.6m-config
lrwxrwxrwx 1 root root 32 12 déc. 14:55 /usr/bin/python3.6m -> /usr/libexec/platform-python3.6m
lrwxrwxrwx 1 root root 39 12 déc. 14:55 /usr/bin/python3.6m-config -> /usr/libexec/platform-python3.6m-config
lrwxrwxrwx 1 root root 46 12 déc. 14:55 /usr/bin/python3.6m-x86_64-config -> /usr/libexec/platform-python3.6m-x86_64-config
lrwxrwxrwx 1 root root 32 21 nov. 2023 /usr/bin/python3-config -> /etc/alternatives/python3-config

```

On not working DBServer python3.12 is installed :

```auto
[root@KODBSERVER etc]# ll /usr/bin/python3*
lrwxrwxrwx 1 root root 25 20 juin 2024 /usr/bin/python3 -> /etc/alternatives/python3
-rwxr-xr-x 1 root root 7752 12 déc. 14:05 /usr/bin/python3.12
lrwxrwxrwx 1 root root 31 12 déc. 14:55 /usr/bin/python3.6 -> /usr/libexec/platform-python3.6
lrwxrwxrwx 1 root root 17 12 déc. 14:55 /usr/bin/python3.6-config -> python3.6m-config
lrwxrwxrwx 1 root root 32 12 déc. 14:55 /usr/bin/python3.6m -> /usr/libexec/platform-python3.6m
lrwxrwxrwx 1 root root 39 12 déc. 14:55 /usr/bin/python3.6m-config -> /usr/libexec/platform-python3.6m-config
lrwxrwxrwx 1 root root 46 12 déc. 14:55 /usr/bin/python3.6m-x86_64-config -> /usr/libexec/platform-python3.6m-x86_64-config
lrwxrwxrwx 1 root root 32 20 juin 2024 /usr/bin/python3-config -> /etc/alternatives/python3-config

```

The alternative for python3 pointed target [/usr/bin/python3.6] :

```auto
[root@KODBSERVER etc]# ll /etc/alternatives/python3
lrwxrwxrwx 1 root root 18 20 juin 2024 /etc/alternatives/python3 -> /usr/bin/python3.6

```

I don’t know why python3.12 is installed on some DBServer…

Matt

---

_[View the full topic](https://forum.ansible.com/t/problem-to-install-or-detect-if-passlib-module-is-installed/43202)._
