# Not able to use selinux module with ansible version 2.14 and python version 3.9

**URL:** <https://forum.ansible.com/t/not-able-to-use-selinux-module-with-ansible-version-2-14-and-python-version-3-9/41398>\
**Category:** Get Help\
**Tags:** rhel\
**Created:** [March 28, 2025, 1:50pm UTC](https://forum.ansible.com/t/not-able-to-use-selinux-module-with-ansible-version-2-14-and-python-version-3-9/41398 "2025-03-28T13:50:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harshit\_Gupta](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/harshit_gupta/32/8010_2.png) [@Harshit\_Gupta](https://forum.ansible.com/u/Harshit_Gupta)\
**Post date:** [March 28, 2025, 1:50pm UTC](https://forum.ansible.com/t/not-able-to-use-selinux-module-with-ansible-version-2-14-and-python-version-3-9/41398/1 "2025-03-28T13:50:34Z")

</div>

Hello Team,

I am not able to use selinux module with below version:

Ansible: 2.14  
Python: 3.9

All the packages are already installed

```auto
ModuleNotFoundError: No module named 'selinux'
fatal: [localhost]: FAILED! => changed=false 
  invocation:
    module_args:
      configfile: /etc/selinux/config
      policy: targeted
      state: enforcing
      update_kernel_param: false
  msg: Failed to import the required Python library (libselinux-python) on 

```

---

<div class="post-metadata">

**Author:** ![bcoca](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/bcoca/32/9269_2.png) [@bcoca](https://forum.ansible.com/u/bcoca)\
**Post date:** [March 28, 2025, 7:36pm UTC](https://forum.ansible.com/t/not-able-to-use-selinux-module-with-ansible-version-2-14-and-python-version-3-9/41398/2 "2025-03-28T19:36:44Z")

</div>

Newer versions of Ansible include their own selinux bindings, but in the past (specially for something as old as 2.14) these were not always present or installable, you need to use the Python with these bindings installed on the target (normally the system Python) or install them yourself on the Python which you wishtto use.
