# vSphere Playbook runs from Ansible Tower but not when run with Ansible-Playbook

**URL:** <https://forum.ansible.com/t/vsphere-playbook-runs-from-ansible-tower-but-not-when-run-with-ansible-playbook/35442>\
**Category:** Ansible Project\
**Tags:** vmware\
**Created:** [June 30, 2021, 2:34pm UTC](https://forum.ansible.com/t/vsphere-playbook-runs-from-ansible-tower-but-not-when-run-with-ansible-playbook/35442 "2021-06-30T14:34:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![david.burtton](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@david.burtton](https://forum.ansible.com/u/david.burtton)\
**Post date:** [June 30, 2021, 2:34pm UTC](https://forum.ansible.com/t/vsphere-playbook-runs-from-ansible-tower-but-not-when-run-with-ansible-playbook/35442/1 "2021-06-30T14:34:46Z")

</div>

I’ve written a playbook to interact with a VMWare vSphere instance I have which will start up a set of VMs however I’m running into an issue where I **can’t** run the playbook using _ansible-playbook_ but I **can** run it from within _Tower_.

I have the community.vmware module installed on my node.

The error I’m getting relates to PyVmomi not being installed or unable to be found by ansible-playbook:

_“Failed to import the required Python library (PyVmomi) on bmtower-3-01’s Python /usr/libexec/platform-python. Please read module documentation and install in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible\_python\_interpreter”_

Any help would be much appreciated!

Thanks

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [June 30, 2021, 2:37pm UTC](https://forum.ansible.com/t/vsphere-playbook-runs-from-ansible-tower-but-not-when-run-with-ansible-playbook/35442/2 "2021-06-30T14:37:47Z")

</div>

Yoy need to install the pyvomi through pip on your machine. Create a virtual environment if needed

---

<div class="post-metadata">

**Author:** ![david.burtton](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@david.burtton](https://forum.ansible.com/u/david.burtton)\
**Post date:** [June 30, 2021, 4:11pm UTC](https://forum.ansible.com/t/vsphere-playbook-runs-from-ansible-tower-but-not-when-run-with-ansible-playbook/35442/3 "2021-06-30T16:11:38Z")

</div>

Thanks a ton!

Installed PyVmomi and everything’s up and running again
