# "requests\_ntlm is not installed", when it appears to be in place

**URL:** <https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519>\
**Category:** Ansible Project\
**Created:** [May 14, 2018, 12:59am UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519 "2018-05-14T00:59:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ab\_Generette](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Ab\_Generette](https://forum.ansible.com/u/Ab_Generette)\
**Post date:** [May 14, 2018, 12:59am UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/1 "2018-05-14T00:59:57Z")

</div>

Has anyone out there seen this issue – when running win\_ping against a host – and been able to resolve it(?):

> \< target host \> | UNREACHABLE! =\> {
> 
> “changed”: false,
> 
> “msg”: “ntlm: requested auth method is ntlm, but requests\_ntlm is not installed”,
> 
> “unreachable”: true
> 
> }

Checking what I have installed, I see:

---

<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:** [May 14, 2018, 4:04am UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/2 "2018-05-14T04:04:54Z")

</div>

I would try and import the requests\_ntlm package and try and find out why it is failing to be imported. It could be that a required package like cryptography isn’t installed. To do this run

`  
python -c “from requests\_ntlm import HttpNtlmAuth”

`

If the import fails it will give you an error saying what it failed to import and give you an indication of what needs to happen. Make sure when you are testing this you are running the command on the Python that Ansible is installed from.

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Ab\_Generette](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Ab\_Generette](https://forum.ansible.com/u/Ab_Generette)\
**Post date:** [May 14, 2018, 2:22pm UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/3 "2018-05-14T14:22:05Z")

</div>

Ok,

Here’s what I got, so, I’ll see what I can find on the module mentioned:

MacBook-Pro:playbooks anthony$ python -c “from requests\_ntlm import HttpNtlmAuth”  
Traceback (most recent call last):  
File “”, line 1, in   
File “/Library/Python/2.7/site-packages/requests\_ntlm/ **init**.py”, line 1, in   
from .requests\_ntlm import HttpNtlmAuth  
File “/Library/Python/2.7/site-packages/requests\_ntlm/requests\_ntlm.py”, line 5, in   
from cryptography import x509  
ImportError: No module named cryptography

---

<div class="post-metadata">

**Author:** ![Ab\_Generette](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Ab\_Generette](https://forum.ansible.com/u/Ab_Generette)\
**Post date:** [May 14, 2018, 2:26pm UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/4 "2018-05-14T14:26:51Z")

</div>

'Looks like the system sees it as already being installed:

MacBook-Pro:playbooks anthony$ pip2.7 install pycrypto  
Requirement already satisfied (use --upgrade to upgrade): pycrypto in /Library/Python/2.7/site-packages  
Cleaning up…

---

<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:** [May 14, 2018, 7:10pm UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/5 "2018-05-14T19:10:10Z")

</div>

Pycrypto is not the same as cryptography, the package is literally called cryptography and should be installed.

Thanks

Jordan

---

<div class="post-metadata">

**Author:** ![Ab\_Generette](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Ab\_Generette](https://forum.ansible.com/u/Ab_Generette)\
**Post date:** [May 14, 2018, 7:21pm UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/6 "2018-05-14T19:21:11Z")

</div>

I’m still getting the same error:

(ansible) MacBook-Pro:playbooks anthony$ ansible wrk04 -e @~/.ansible/secure.yml -m win\_ping --ask-vault-pass  
Vault password:  
wrk04 | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “ntlm: requested auth method is ntlm, but requests\_ntlm is not installed”,  
“unreachable”: true  
}  
(ansible) MacBook-Pro:playbooks anthony$ pip freeze | grep crypto  
asn1crypto==0.24.0  
cryptography==2.2.2

---

<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:** [May 14, 2018, 7:44pm UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/7 "2018-05-14T19:44:41Z")

</div>

Are you still getting the import error when trying to manually import cryptography, you need to solve that first before using Ansible.

---

<div class="post-metadata">

**Author:** ![Ab\_Generette](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Ab\_Generette](https://forum.ansible.com/u/Ab_Generette)\
**Post date:** [May 14, 2018, 8:37pm UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/8 "2018-05-14T20:37:32Z")

</div>

No, I’m no longer seeing the error on attempt to manually import cryptography.

---

<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:** [May 14, 2018, 8:46pm UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/9 "2018-05-14T20:46:50Z")

</div>

What about import requests\_ntlm? If that works but Ansible doesn’t it sounds like Ansible is using a different Python interpreter to the one you tested on.

---

<div class="post-metadata">

**Author:** ![Ab\_Generette](https://avatars.discourse-cdn.com/v4/letter/a/aca169/32.png) [@Ab\_Generette](https://forum.ansible.com/u/Ab_Generette)\
**Post date:** [May 14, 2018, 8:59pm UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/10 "2018-05-14T20:59:46Z")

</div>

Does this shed any light(?):

(ansible) MacBook-Pro:playbooks anthony$ ansible wrk04 -e @~/.ansible/secure.yml -m win\_ping --ask-vault-pass  
Vault password:  
wrk04 | UNREACHABLE! =\> {  
“changed”: false,  
“msg”: “ntlm: requested auth method is ntlm, but requests\_ntlm is not installed”,  
“unreachable”: true  
}  
(ansible) MacBook-Pro:playbooks anthony$ python -c “from requests\_ntlm import requests\_ntlm”  
(ansible) MacBook-Pro:playbooks anthony$ echo $?  
0  
(ansible) MacBook-Pro:playbooks anthony$ python -c “import requests\_ntlm”  
(ansible) MacBook-Pro:playbooks anthony$ echo $?  
0  
(ansible) MacBook-Pro:playbooks anthony$ which python  
/Users/anthony/ansible/bin/python  
(ansible) MacBook-Pro:playbooks anthony$ ansible --version  
ansible 2.5.0  
config file = /Users/anthony/.ansible.cfg  
configured module search path = [u’/Users/anthony/.ansible/plugins/modules’, u’/usr/share/ansible/plugins/modules’]  
ansible python module location = /Library/Python/2.7/site-packages/ansible  
executable location = /usr/local/bin/ansible  
python version = 2.7.10 (default, Oct 6 2017, 22:29:07) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.31)]

---

<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:** [May 14, 2018, 9:35pm UTC](https://forum.ansible.com/t/requests-ntlm-is-not-installed-when-it-appears-to-be-in-place/27519/11 "2018-05-14T21:35:02Z")

</div>

Looks like the python on your PATH is at /Users/anthony/ansible/bin/python but the Ansible command is on /Library/Python/2.7 which is different.
