No module named "winrm"

Hello there!
I am newbie on ansible, and have problem with in one of the tasks.
I was creating a virtual machine, and when playbook get to the point
“Check whether AD group exist” stopped with error

" {“msg”: “winrm or requests is not installed: No module named ‘winrm’”"

Task include the module “community.windows.win_domain_object_info”
and delegate_to “proxy server” where this proxy server connected to server AD and check AD Group.

I tried install this package
$ pip install pywinrm

But, have answer

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pywinrm in /usr/local/lib/python3.8/site-packages (0.4.3)
Requirement already satisfied: xmltodict in /usr/local/lib/python3.8/site-packages (from pywinrm) (0.13.0)
Requirement already satisfied: requests>=2.9.1 in /usr/local/lib/python3.8/site-packages (from pywinrm) (2.28.1)
Requirement already satisfied: requests-ntlm>=1.1.0 in /usr/local/lib/python3.8/site-packages (from pywinrm) (1.1.0)
Requirement already satisfied: six in /usr/lib/python3.8/site-packages (from pywinrm) (1.16.0)
Requirement already satisfied: charset-normalizer<3,>=2 in /usr/local/lib/python3.8/site-packages (from requests>=2.9.1->pywinrm) (2.1.1)
Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.8/site-packages (from requests>=2.9.1->pywinrm) (3.4)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/site-packages (from requests>=2.9.1->pywinrm) (1.26.12)
Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/site-packages (from requests>=2.9.1->pywinrm) (2022.9.24)
Requirement already satisfied: ntlm-auth>=1.0.2 in /usr/local/lib/python3.8/site-packages (from requests-ntlm>=1.1.0->pywinrm) (1.5.0)
Requirement already satisfied: cryptography>=1.3 in /usr/lib64/python3.8/site-packages (from requests-ntlm>=1.1.0->pywinrm) (3.1.1)
Requirement already satisfied: cffi!=1.11.3,>=1.8 in /usr/lib64/python3.8/site-packages (from cryptography>=1.3->requests-ntlm>=1.1.0->pywinrm) (1.15.0)
Requirement already satisfied: pycparser in /usr/lib/python3.8/site-packages (from cffi!=1.11.3,>=1.8->cryptography>=1.3->requests-ntlm>=1.1.0->pywinrm) (2.20)

The interesting thing is that my coworkers and I log into the ansible server under AD accounts, then do “sudo su” and work and build under root. And I’m the only one with this problem
Any answers would be helpful.

Thanks you!

If others are able to run the playbook from the same Ansible server, under the same ID, using the same credentials to connect to (proxy/end server), then it is something you are doing differently, or something different about your access/setup.

I would have a colleague show you / record exactly what they are doing, and evaluate the differences.

What does ansible --version show you? Is the python version starting with /usr/local/bin or something else? It sounds like potentially the Python that Ansible is using is not the same as the one that pip is installing the package to.

Thanks for your replies, i’ll try