ERROR! Unexpected Exception, this is probably a bug: No module named 'psutil'

Problem:
I can no longer run any ansible playbook.
I only get “ERROR! Unexpected Exception, this is probably a bug: No module named ‘psutil’”

I’ve searched far and wide but it appears I’m the only one in the world having this exact issue :frowning:
I don’t have a virtualenv

Expected outcome:
That my playbooks work

Foreman and Proxy versions:
both 1.24.1

Foreman and Proxy plugin versions:
ansible 3.01
smart proxy core 3.02

Distribution and version:
Centos 7.5

Other relevant data:

have you tried to update the ansible plugin? With 1.23.x in RHEL7 I’ve the version 3.0.9. Maybe it’s part of the issues with foreman 1.24 and ansible (check the support board…)

Also had this problem.
I was trying to install the Napalm module for Ansible manually and had previously run the command :

pip3 install ansible

This apparently dropped a Python 3 version of Ansible in /usr/local/bin. And the psutil module was not installed for Python3 (it was for Python 2).

pip3 install psutil

Fixed atleast that specific error for me.

Since I wasn’t so sure how Foreman supported Ansible with Python3 I ended up though just running : pip3 uninstall ansible

And then removing /usr/local/bin/ansible, which reverted to the previous Python2 version of Ansible in /bin/ansible