I’m trying to make the “expect” module in ansible, and I get
`
fatal: [localhost]: FAILED! => {“changed”: false, “failed”: true, “msg”: “Insufficient version of pexpect installed (2.3), this module requires pexpect>=3.3. Error was ‘module’ object has no attribute ‘runu’”}
`
But pip tells me I already pexpect version 4.5.0?
`
$ pip2.7 install --upgrade pexpect
Requirement already up-to-date: pexpect in /usr/local/lib/python2.7/site-packages (4.5.0)
Requirement not upgraded as not directly required: ptyprocess>=0.5 in /usr/local/lib/python2.7/site-packages (from pexpect) (0.5.2)
It requires it on the machine and python the module executes on, use
-vvv to verify you are matching both, by default the implicit
localhost should ensure that they are the same as you expect, but if
you added localhost to your inventory you might be using a different
python http://docs.ansible.com/ansible/latest/inventory/implicit_localhost.html
The -i 'localhost,' is probably what is causing the issue as you are
defining localhost, see the docs i linked in previous message for a
full explanation.