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
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.
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
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.