ImportError: cannot import name '_psutil_linux'

Hello there.

I’ve created a new venv to install the necessary dependency required by:
https://github.com/ansible-collections/community.vmware

when i execute my template in this venv i got this error.

Here is the complete log:

ansible-playbook 2.9.17
config file = /etc/ansible/ansible.cfg
configured module search path = [‘/var/lib/awx/.ansible/plugins/modules’, ‘/usr/share/ansible/plugins/modules’]
ansible python module location = /usr/lib/python3.6/site-packages/ansible
executable location = /usr/bin/ansible-playbook
python version = 3.6.8 (default, Aug 24 2020, 17:57:11) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
Using /etc/ansible/ansible.cfg as config file
SSH password:
host_list declined parsing /tmp/awx_43_23nqyhli/tmpa5fooimo as it did not pass its verify_file() method
[WARNING]: Invalid characters were found in group names but not replaced, use
-vvvv to see details
Parsed /tmp/awx_43_23nqyhli/tmpa5fooimo inventory source with script plugin
ERROR! Unexpected Exception, this is probably a bug: cannot import name ‘_psutil_linux’
the full traceback was:
Traceback (most recent call last):
File “/usr/bin/ansible-playbook”, line 123, in
exit_code = cli.run()
File “/usr/lib/python3.6/site-packages/ansible/cli/playbook.py”, line 128, in run
results = pbex.run()
File “/usr/lib/python3.6/site-packages/ansible/executor/playbook_executor.py”, line 99, in run
self._tqm.load_callbacks()
File “/usr/lib/python3.6/site-packages/ansible/executor/task_queue_manager.py”, line 136, in load_callbacks
self._stdout_callback = callback_loader.get(self._stdout_callback)
File “/usr/lib/python3.6/site-packages/ansible/plugins/loader.py”, line 552, in get
self._module_cache[path] = self._load_module_source(name, path)
File “/usr/lib/python3.6/site-packages/ansible/plugins/loader.py”, line 525, in _load_module_source
spec.loader.exec_module(module)
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/callbacks/awx_display.py”, line 44, in
from display_callback import AWXDefaultCallbackModule # noqa
File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/display_callback/init.py”, line 21, in
from . import cleanup # noqa (registers control persistent cleanup)
File “/var/lib/awx/venv/awx/lib/python3.6/site-packages/ansible_runner/display_callback/cleanup.py”, line 27, in
import psutil
File “/opt/venvs/vmware_venv/lib/python3.8/site-packages/psutil/init.py”, line 101, in
from . import _pslinux as _psplatform
File “/opt/venvs/vmware_venv/lib/python3.8/site-packages/psutil/_pslinux.py”, line 26, in
from . import _psutil_linux as cext
ImportError: cannot import name ‘_psutil_linux’

and what is inside the venv:

root@awx:/opt/venvs# /opt/venvs/vmware_venv/bin/pip list
Package Version


certifi 2020.12.5
cffi 1.14.4
chardet 4.0.0
cryptography 3.4.3
idna 2.10
Jinja2 2.11.3
lxml 4.6.2
MarkupSafe 1.1.1
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
pip 21.0.1
psutil 5.7.0
pycparser 2.20
pyOpenSSL 20.0.1
pyvmomi 6.7.3
PyYAML 5.4.1
requests 2.25.1
setuptools 53.0.0
six 1.15.0
suds-jurko 0.6
urllib3 1.26.3
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
vSphere-Automation-SDK 1.47.0
wheel 0.36.2

Thanks.