# No module named "winrm"

**URL:** <https://forum.ansible.com/t/no-module-named-winrm/3235>\
**Category:** Get Help\
**Tags:** windows, collections\
**Created:** [January 10, 2024, 3:36am UTC](https://forum.ansible.com/t/no-module-named-winrm/3235 "2024-01-10T03:36:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![shadow](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@shadow](https://forum.ansible.com/u/shadow)\
**Post date:** [January 10, 2024, 3:36am UTC](https://forum.ansible.com/t/no-module-named-winrm/3235/1 "2024-01-10T03:36:48Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jrglynn2](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jrglynn2](https://forum.ansible.com/u/jrglynn2)\
**Post date:** [January 10, 2024, 4:36pm UTC](https://forum.ansible.com/t/no-module-named-winrm/3235/2 "2024-01-10T16:36:55Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![jborean](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/jborean/32/1525_2.png) [@jborean](https://forum.ansible.com/u/jborean)\
**Post date:** [January 10, 2024, 8:31pm UTC](https://forum.ansible.com/t/no-module-named-winrm/3235/3 "2024-01-10T20:31:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![shadow](https://avatars.discourse-cdn.com/v4/letter/s/5fc32e/32.png) [@shadow](https://forum.ansible.com/u/shadow)\
**Post date:** [January 11, 2024, 10:07pm UTC](https://forum.ansible.com/t/no-module-named-winrm/3235/4 "2024-01-11T22:07:34Z")

</div>

Thanks for your replies, i’ll try
