# Install pyvcloud in awx venv

**URL:** <https://forum.ansible.com/t/install-pyvcloud-in-awx-venv/28416>\
**Category:** AWX Project\
**Tags:** vmware, awx\
**Created:** [August 24, 2018, 2:11pm UTC](https://forum.ansible.com/t/install-pyvcloud-in-awx-venv/28416 "2018-08-24T14:11:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias\_Didier](https://avatars.discourse-cdn.com/v4/letter/m/a88e4f/32.png) [@Mathias\_Didier](https://forum.ansible.com/u/Mathias_Didier)\
**Post date:** [August 24, 2018, 2:11pm UTC](https://forum.ansible.com/t/install-pyvcloud-in-awx-venv/28416/1 "2018-08-24T14:11:24Z")

</div>

Hello community

I am struggling with installing pyvcloud in awx venv.

pyvcloud is the Python SDK for VMware vCloud Director: [https://github.com/vmware/pyvcloud](https://github.com/vmware/pyvcloud)  
It requires Python 3.

I was able to install pyvcloud in a awx task container based on the docker image " ansible/awx\_task:1.0.6.15":

[root@awx awx]# /var/lib/awx/venv/ansible/bin/pip install pyvcloud  
Requirement already satisfied: pyvcloud in /root/.local/lib/python2.7/site-packages (19.3.0)  
Requirement already satisfied: PyYAML\>=3.10 in ./venv/ansible/lib/python2.7/site-packages (from pyvcloud) (3.12)  
Requirement already satisfied: humanfriendly\>=4.8 in ./venv/ansible/lib/python2.7/site-packages (from pyvcloud) (4.8)  
Requirement already satisfied: pygments\>=2.2.0 in ./venv/ansible/lib/python2.7/site-packages (from pyvcloud) (2.2.0)  
Requirement already satisfied: lxml\>=3.4.1 in ./venv/ansible/lib/python2.7/site-packages (from pyvcloud) (4.1.1)  
Requirement already satisfied: flufl.enum\>=4.1.1 in /root/.local/lib/python2.7/site-packages (from pyvcloud) (4.1.1)  
Requirement already satisfied: requests\>=2.18.4 in ./venv/ansible/lib/python2.7/site-packages (from pyvcloud) (2.19.1)  
Requirement already satisfied: monotonic; python\_version == “2.6” or python\_version == “2.7” or python\_version == “3.0” or python\_version == “3.1” or python\_version == “3.2” in ./venv/ansible/lib/python2.7/site-packages (from humanfriendly\>=4.8-\>pyvcloud) (1.4)  
Requirement already satisfied: idna\<2.8,\>=2.5 in ./venv/ansible/lib/python2.7/site-packages (from requests\>=2.18.4-\>pyvcloud) (2.7)  
Requirement already satisfied: chardet\<3.1.0,\>=3.0.2 in ./venv/ansible/lib/python2.7/site-packages (from requests\>=2.18.4-\>pyvcloud) (3.0.4)  
Requirement already satisfied: urllib3\<1.24,\>=1.21.1 in ./venv/ansible/lib/python2.7/site-packages (from requests\>=2.18.4-\>pyvcloud) (1.23)  
Requirement already satisfied: certifi\>=2017.4.17 in ./venv/ansible/lib/python2.7/site-packages (from requests\>=2.18.4-\>pyvcloud) (2018.8.24)

When I run a playbook from within awx:

- name: Create a vapp in VCloud Director  
hosts: ‘{{ hostname }}’  
connection: local  
gather\_facts: False  
tasks:
- name: Creates a new vApp in a VCA instance  
vca\_vapp:  
vapp\_name: Test  
state: present  
vdc\_name: ‘{{ vdc\_name }}’  
instance\_id: ‘test’  
username: ‘{{ vcloud\_user }}’  
password: ‘{{ vcloud\_pass word }}’

I get this error:

FAILED! =\> {“changed”: false, “msg”: “python module pyvcloud is required for this module”}

Can anyone help me get this working?

Thanks in advance  
Mathias

---

<div class="post-metadata">

**Author:** ![Christopher\_Meyers](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@Christopher\_Meyers](https://forum.ansible.com/u/Christopher_Meyers)\
**Post date:** [August 27, 2018, 12:14pm UTC](https://forum.ansible.com/t/install-pyvcloud-in-awx-venv/28416/2 "2018-08-27T12:14:20Z")

</div>

The local connection is going to still go through Ansible’s logic of coping the module to a tmp directory and invoking another python instance to run the copied module. You need to override ansible’s interpreter location see [https://docs.ansible.com/ansible/2.6/reference\_appendices/faq.html#how-do-i-handle-python-not-having-a-python-interpreter-at-usr-bin-python-on-a-remote-machine](https://docs.ansible.com/ansible/2.6/reference_appendices/faq.html#how-do-i-handle-python-not-having-a-python-interpreter-at-usr-bin-python-on-a-remote-machine)
