Also tried below :
mkdir ansible-vmware-project
cd ansible-vmware-project/
git clone https://github.com/vmware/vsphere-automation-sdk-python.git
python3 -m venv venv
source venv/bin/activate
cd vsphere-automation-sdk-python
pip install --upgrade pip setuptools
Collecting pip
Downloading https://files.pythonhosted.org/packages/fe/ef/60d7ba03b5c442309ef42e7d69959f73aacccd0d86008362a681c4698e83/pip-21.0.1-py3-none-any.whl (1.5MB)
100% |████████████████████████████████| 1.5MB 990kB/s
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/15/0e/255e3d57965f318973e417d5b7034223f1223de500d91b945ddfaef42a37/setuptools-53.0.0-py3-none-any.whl (784kB)
100% |████████████████████████████████| 788kB 2.0MB/s
Installing collected packages: pip, setuptools
Found existing installation: pip 9.0.1
Uninstalling pip-9.0.1:
Successfully uninstalled pip-9.0.1
Found existing installation: setuptools 36.5.0
Uninstalling setuptools-36.5.0:
Successfully uninstalled setuptools-36.5.0
Successfully installed pip-21.0.1 setuptools-53.0.0
pip install --upgrade git+https://github.com/vmware/vsphere-automation-sdk-python.git
Collecting git+https://github.com/vmware/vsphere-automation-sdk-python.git
Cloning https://github.com/vmware/vsphere-automation-sdk-python.git to /tmp/pip-req-build-3ciikd1i
Running command git clone -q https://github.com/vmware/vsphere-automation-sdk-python.git /tmp/pip-req-build-3ciikd1i
Processing //tmp/pip-req-build-3ciikd1i/lib/vapi-runtime/vapi_runtime-2.19.0-py2.py3-none-any.whl
Processing //tmp/pip-req-build-3ciikd1i/lib/vapi-client-bindings/vapi_client_bindings-3.5.0-py2.py3-none-any.whl
Processing //tmp/pip-req-build-3ciikd1i/lib/vapi-common-client/vapi_common_client-2.19.0-py2.py3-none-any.whl
Processing //tmp/pip-req-build-3ciikd1i/lib/vmc-client-bindings/vmc_client_bindings-1.33.0-py2.py3-none-any.whl
Processing //tmp/pip-req-build-3ciikd1i/lib/nsx-python-sdk/nsx_python_sdk-3.0.2.0.0.16837625-py2.py3-none-any.whl
Processing //tmp/pip-req-build-3ciikd1i/lib/nsx-policy-python-sdk/nsx_policy_python_sdk-3.0.2.0.0.16837625-py2.py3-none-any.whl
Processing //tmp/pip-req-build-3ciikd1i/lib/nsx-vmc-policy-python-sdk/nsx_vmc_policy_python_sdk-3.0.2.0.0.16837625-py2.py3-none-any.whl
Processing //tmp/pip-req-build-3ciikd1i/lib/nsx-vmc-aws-integration-python-sdk/nsx_vmc_aws_integration_python_sdk-3.0.2.0.0.16837625-py2.py3-none-any.whl
Processing //tmp/pip-req-build-3ciikd1i/lib/vmc-draas-client-bindings/vmc_draas_client_bindings-1.17.0-py2.py3-none-any.whl
Collecting lxml>=4.3.0
Downloading lxml-4.6.2-cp36-cp36m-manylinux1_x86_64.whl (5.5 MB)
████████████████████████████████| 5.5 MB 16.7 MB/s
Collecting pyVmomi>=6.7
Downloading pyvmomi-7.0.1.tar.gz (584 kB)
████████████████████████████████| 584 kB 93.1 MB/s
Collecting suds-jurko
Downloading suds-jurko-0.6.zip (255 kB)
████████████████████████████████| 255 kB 81.6 MB/s
Requirement already satisfied: setuptools in /root/ansible-vmware-project/venv/lib/python3.6/site-packages (from vapi-client-bindings@ file://localhost//tmp/pip-req-build-3ciikd1i/lib/vapi-client-bindings/vapi_client_bindings-3.5.0-py2.py3-none-any.whl->vSphere-Automation-SDK==1.47.0) (53.0.0)
Collecting pyOpenSSL>=18.0.0
Downloading pyOpenSSL-20.0.1-py2.py3-none-any.whl (54 kB)
████████████████████████████████| 54 kB 7.2 MB/s
Collecting six>=1.12
Downloading six-1.15.0-py2.py3-none-any.whl (10 kB)
Collecting requests>=2.21.0
Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
████████████████████████████████| 61 kB 20.6 MB/s
Collecting cryptography>=3.2
Downloading cryptography-3.4.4-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB)
████████████████████████████████| 3.2 MB 85.7 MB/s
Collecting cffi>=1.12
Downloading cffi-1.14.5-cp36-cp36m-manylinux1_x86_64.whl (401 kB)
████████████████████████████████| 401 kB 77.6 MB/s
Collecting pycparser
Downloading pycparser-2.20-py2.py3-none-any.whl (112 kB)
████████████████████████████████| 112 kB 105.6 MB/s
Collecting certifi>=2017.4.17
Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
████████████████████████████████| 147 kB 95.7 MB/s
Collecting chardet<5,>=3.0.2
Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
████████████████████████████████| 178 kB 88.0 MB/s
Collecting idna<3,>=2.5
Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
████████████████████████████████| 58 kB 15.8 MB/s
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.3-py2.py3-none-any.whl (137 kB)
████████████████████████████████| 137 kB 100.6 MB/s
Using legacy ‘setup.py install’ for vSphere-Automation-SDK, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for pyVmomi, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for suds-jurko, since package ‘wheel’ is not installed.
Installing collected packages: pycparser, cffi, urllib3, six, idna, cryptography, chardet, certifi, requests, pyOpenSSL, vapi-runtime, vapi-common-client, vmc-draas-client-bindings, vmc-client-bindings, vapi-client-bindings, suds-jurko, pyVmomi, nsx-vmc-policy-python-sdk, nsx-vmc-aws-integration-python-sdk, nsx-python-sdk, nsx-policy-python-sdk, lxml, vSphere-Automation-SDK
Running setup.py install for suds-jurko … done
Running setup.py install for pyVmomi … done
Running setup.py install for vSphere-Automation-SDK … done
Successfully installed certifi-2020.12.5 cffi-1.14.5 chardet-4.0.0 cryptography-3.4.4 idna-2.10 lxml-4.6.2 nsx-policy-python-sdk-3.0.2.0.0.16837625 nsx-python-sdk-3.0.2.0.0.16837625 nsx-vmc-aws-integration-python-sdk-3.0.2.0.0.16837625 nsx-vmc-policy-python-sdk-3.0.2.0.0.16837625 pyOpenSSL-20.0.1 pyVmomi-7.0.1 pycparser-2.20 requests-2.25.1 six-1.15.0 suds-jurko-0.6 urllib3-1.26.3 vSphere-Automation-SDK-1.47.0 vapi-client-bindings-3.5.0 vapi-common-client-2.19.0 vapi-runtime-2.19.0 vmc-client-bindings-1.33.0 vmc-draas-client-bindings-1.17.0
export PYTHONPATH=${PWD}:$PYTHONPATH
ansible-galaxy collection install community.vmware
Process install dependency map
Starting collection install process
Installing ‘community.vmware:1.7.0’ to ‘/root/.ansible/collections/ansible_collections/community/vmware’
ansible-inventory --list -i DC-inv-ALL-vmware.yml
[WARNING]: * Failed to parse /root/ansible-vmware-project/vsphere-automation-sdk-python/playbooks/DC-inv-ALL-vmware.yml with auto plugin: Please install “PyVmomi” Python module
as this is required for VMware Guest dynamic inventory plugin.
[WARNING]: * Failed to parse /root/ansible-vmware-project/vsphere-automation-sdk-python/playbooks/DC-inv-ALL-vmware.yml with yaml plugin: Plugin configuration YAML file, not
YAML inventory
[WARNING]: * Failed to parse /root/ansible-vmware-project/vsphere-automation-sdk-python/playbooks/DC-inv-ALL-vmware.yml with ini plugin: Invalid host pattern ‘plugin:’ supplied,
ending in ‘:’ is not allowed, this character is reserved to provide a port.
[WARNING]: Unable to parse /root/ansible-vmware-project/vsphere-automation-sdk-python/playbooks/DC-inv-ALL-vmware.yml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
“_meta”: {
“hostvars”: {}
},
“all”: {
“children”: [
“ungrouped”
]
}
}
BTW
pip install pyvmomi
Requirement already satisfied: pyvmomi in /root/ansible-vmware-project/venv/lib/python3.6/site-packages (7.0.1)
Requirement already satisfied: requests>=2.3.0 in /root/ansible-vmware-project/venv/lib/python3.6/site-packages (from pyvmomi) (2.25.1)
Requirement already satisfied: six>=1.7.3 in /root/ansible-vmware-project/venv/lib/python3.6/site-packages (from pyvmomi) (1.15.0)
Requirement already satisfied: certifi>=2017.4.17 in /root/ansible-vmware-project/venv/lib/python3.6/site-packages (from requests>=2.3.0->pyvmomi) (2020.12.5)
Requirement already satisfied: urllib3<1.27,>=1.21.1 in /root/ansible-vmware-project/venv/lib/python3.6/site-packages (from requests>=2.3.0->pyvmomi) (1.26.3)
Requirement already satisfied: chardet<5,>=3.0.2 in /root/ansible-vmware-project/venv/lib/python3.6/site-packages (from requests>=2.3.0->pyvmomi) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in /root/ansible-vmware-project/venv/lib/python3.6/site-packages (from requests>=2.3.0->pyvmomi) (2.10)