# Error: "ImportError: No module named grp" when running playbook against windows

**URL:** <https://forum.ansible.com/t/error-importerror-no-module-named-grp-when-running-playbook-against-windows/22787>\
**Category:** Ansible Project\
**Tags:** windows\
**Created:** [October 13, 2016, 6:12pm UTC](https://forum.ansible.com/t/error-importerror-no-module-named-grp-when-running-playbook-against-windows/22787 "2016-10-13T18:12:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_Brelsfoard](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@Sam\_Brelsfoard](https://forum.ansible.com/u/Sam_Brelsfoard)\
**Post date:** [October 13, 2016, 6:12pm UTC](https://forum.ansible.com/t/error-importerror-no-module-named-grp-when-running-playbook-against-windows/22787/1 "2016-10-13T18:12:38Z")

</div>

I’ve seen a couple of other folks have this issue, but I’ve not found any answers/solutions.

I have a playbook that runs fine from an ansible server (CentOS) to a Mac OSX node, however, when I run the same playbook against a Windows node I get an ImportError. Any thoughts?  
example:

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [October 13, 2016, 6:24pm UTC](https://forum.ansible.com/t/error-importerror-no-module-named-grp-when-running-playbook-against-windows/22787/2 "2016-10-13T18:24:32Z")

</div>

Running python modules on Windows isn’t supported or tested (and in most cases just plain won’t work)- would strongly suggest you find a win\_ equivalent to whatever you’re trying to do…

---

<div class="post-metadata">

**Author:** ![Sam\_Brelsfoard](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@Sam\_Brelsfoard](https://forum.ansible.com/u/Sam_Brelsfoard)\
**Post date:** [October 14, 2016, 1:48pm UTC](https://forum.ansible.com/t/error-importerror-no-module-named-grp-when-running-playbook-against-windows/22787/3 "2016-10-14T13:48:31Z")

</div>

All I’m trying to do is run a shell command though. Am I approaching this wrong?  
Here’s my playbook:

---

<div class="post-metadata">

**Author:** ![Matt\_Davis](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matt\_Davis](https://forum.ansible.com/u/Matt_Davis)\
**Post date:** [October 14, 2016, 5:33pm UTC](https://forum.ansible.com/t/error-importerror-no-module-named-grp-when-running-playbook-against-windows/22787/4 "2016-10-14T17:33:40Z")

</div>

Not sure why you’re using ssh/Python to talk to Windows- you _might_ be able to get it to work, but the native Windows management transport that Ansible supports is Powershell over WinRM.

“shell” is still a module, so it requires that Ansible’s basic.py module API and the shell module code itself are functional on the target machine (which is not tested, and clearly has issues).

If you really want to use SSH to just run commands on Windows/cygwin, just do raw: (whatever command)- that won’t subject you to any Python requirements on the Windows side. But if you’re really going to use Ansible the way it was intended, light up WinRM and use the native Windows transport and modules that actually get tested.

---

<div class="post-metadata">

**Author:** ![Sam\_Brelsfoard](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@Sam\_Brelsfoard](https://forum.ansible.com/u/Sam_Brelsfoard)\
**Post date:** [October 14, 2016, 6:27pm UTC](https://forum.ansible.com/t/error-importerror-no-module-named-grp-when-running-playbook-against-windows/22787/5 "2016-10-14T18:27:00Z")

</div>

Excellent. Thanks for the thorough, helpful answer, Matt!  
-Sam
