Getting an ImportError: No module named ansible when running a job in Ansible Tower after an in-place upgrade

Solution Verified - Updated -

Issue

  • After an in place upgrade from RHEL7 to RHEL8, and then upgrading Ansible Tower to 3.8 through setup.sh, the following error appears in stdout of jobs, inventory updates, and project updates:

    RuntimeError: ansible-inventory failed (rc=1) with stdout:
    stderr:
    Traceback (most recent call last):
      File "/usr/bin/ansible-inventory", line 34, in <module>
        from ansible import context
    ImportError: No module named ansible
    

Environment

  • Red Hat Enterprise Linux 8
  • Red Hat Ansible Tower 3.8 or higher

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content