# Problems getting pypsrp to work

**URL:** <https://forum.ansible.com/t/problems-getting-pypsrp-to-work/44563>\
**Category:** Get Help\
**Tags:** windows, ansible\
**Created:** [September 26, 2025, 3:26pm UTC](https://forum.ansible.com/t/problems-getting-pypsrp-to-work/44563 "2025-09-26T15:26:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnny91](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@johnny91](https://forum.ansible.com/u/johnny91)\
**Post date:** [September 26, 2025, 3:26pm UTC](https://forum.ansible.com/t/problems-getting-pypsrp-to-work/44563/1 "2025-09-26T15:26:42Z")

</div>

Hi gang!

I’m trying to switch from winrm to pypsrp in my ansible files to try to make connection more smooth and not getting timed out sometimes when working with Windows machines.

So I added this to my group-vars/all.yml file:  
`ansible_connection: psrp`  
`ansible_port: 5985`  
`ansible_psrp_transport: ntlm`  
`ansible_psrp_server_cert_validation: ignore`  
`ansible_psrp_shell: powershell`

Then I did:  
`pip install pypsrp`  
`pip install ntlm-auth`

But when running my ansible scripts, I get:

> pypsrp or depdencies are not installed. No module named pypsrp

But it’s installed so not sure why I get this, how can I fix this?

---

<div class="post-metadata">

**Author:** ![Lyle\_McKarns](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/lyle_mckarns/32/8142_2.png) [@Lyle\_McKarns](https://forum.ansible.com/u/Lyle_McKarns)\
**Post date:** [September 26, 2025, 4:59pm UTC](https://forum.ansible.com/t/problems-getting-pypsrp-to-work/44563/2 "2025-09-26T16:59:38Z")

</div>

Is `pypsrp` installed in the same python environment as `ansible` and related tools? That could be your system environment, a python virtualenv, or the `ee` that you’re using.

---

<div class="post-metadata">

**Author:** ![johnny91](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@johnny91](https://forum.ansible.com/u/johnny91)\
**Post date:** [October 2, 2025, 4:06pm UTC](https://forum.ansible.com/t/problems-getting-pypsrp-to-work/44563/3 "2025-10-02T16:06:46Z")

</div>

Hi,

I tried install pypsrp in a virtualenv where ansible is also installed, but I still get the problem.  
If I type: ansible --version  
It shows ansible core 2.18.8, and python version 3.12.3

If I’m not inside virtualenv, then I install pypsrp with:  
pipx install pypsrp --include-deps --force

But still I get the probelm after that that “pypsrp is not found”.

---

<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:** [October 2, 2025, 7:27pm UTC](https://forum.ansible.com/t/problems-getting-pypsrp-to-work/44563/4 "2025-10-02T19:27:21Z")

</div>

What’s the `python version` output of `ansible --version`. Is it the same base location that `pip`/`pipx` is installing pypsrp to?

---

<div class="post-metadata">

**Author:** ![johnny91](https://avatars.discourse-cdn.com/v4/letter/j/cab0a1/32.png) [@johnny91](https://forum.ansible.com/u/johnny91)\
**Post date:** [October 6, 2025, 3:58pm UTC](https://forum.ansible.com/t/problems-getting-pypsrp-to-work/44563/5 "2025-10-06T15:58:14Z")

</div>

I got it to work when going inside the virtualenv and then running pip install ansible, to reinstall it inside the venv so it gets its own installation.

But now, I’m not quite sure which pypsrp settings I need. Do I need a file all.yml inside group\_vars folder with these contents:

```auto
ansible_connection: psrp
ansible_port: 5985
ansible_psrp_transport: ntlm
ansible_psrp_server_cert_validation: ignore
ansible_psrp_shell: powershell

```

Or do I need to add setting sto my inventory.ini file like this:

```auto
[windows_dc:vars]
ansible_connection=psrp
...

```

Because I’m using inventory.ini file where I have the credentials and IP addresses of each machine which I am referring to in my ansible file. But I’m a bit confused where I should put the psrp settings and in which file.

---

<div class="post-metadata">

**Author:** ![Lyle\_McKarns](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/lyle_mckarns/32/8142_2.png) [@Lyle\_McKarns](https://forum.ansible.com/u/Lyle_McKarns)\
**Post date:** [October 6, 2025, 5:15pm UTC](https://forum.ansible.com/t/problems-getting-pypsrp-to-work/44563/6 "2025-10-06T17:15:43Z")

</div>

Setting those values either in `group_vars/all.yml` or `inventories/inventory.ini` will work (note that the syntax will differ slightly depending on which flavor you choose).

If you’re going to use the same settings for all hosts in the inventory file (which is what an `all.yml` would imply), I _personally_ find it more readable to keep it all in the `inventory.ini` file, so that all the information about connecting to a host is located in the same place.
