# Error Msg: The pexpect python module is required

**URL:** <https://forum.ansible.com/t/error-msg-the-pexpect-python-module-is-required/23113>\
**Category:** Ansible Project\
**Created:** [November 27, 2016, 5:12pm UTC](https://forum.ansible.com/t/error-msg-the-pexpect-python-module-is-required/23113 "2016-11-27T17:12:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![neha\_gupta](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@neha\_gupta](https://forum.ansible.com/u/neha_gupta)\
**Post date:** [November 27, 2016, 5:12pm UTC](https://forum.ansible.com/t/error-msg-the-pexpect-python-module-is-required/23113/1 "2016-11-27T17:12:39Z")

</div>

Hi

I am using ansible (version 2.2) for installing a software, where I require “ **expect** ” to be used. I have installed the pexpect module (version 4.2) and Python (version 2.7) in the local and remote server.  
However, on running ansible script, getting following error:

“module\_name”: “expect”

“msg”: “The pexpect python module is required”

Please help.

Regards  
Neha

---

<div class="post-metadata">

**Author:** ![Pavel\_Voinov](https://avatars.discourse-cdn.com/v4/letter/p/b782af/32.png) [@Pavel\_Voinov](https://forum.ansible.com/u/Pavel_Voinov)\
**Post date:** [January 24, 2017, 5:36pm UTC](https://forum.ansible.com/t/error-msg-the-pexpect-python-module-is-required/23113/2 "2017-01-24T17:36:39Z")

</div>

I have similar problem but with a bit different outcome:

Insufficient version of pexpect installed (4.2.1), this module requires pexpect\>=3.3. Error was ‘int’ object has no attribute ‘rstrip’"

Ansible version: **2.2.0.0**  
pexpect version: **4.2.1** (definitely greater than 3.3).

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [January 24, 2017, 11:39pm UTC](https://forum.ansible.com/t/error-msg-the-pexpect-python-module-is-required/23113/3 "2017-01-24T23:39:07Z")

</div>

I’m guessing you are trying to supply an integer as one of the responses, try quoting it like “1”
