Python scripts running on Red Hat Enterprise Linux 8 can not "import yum"

Solution Verified - Updated -

Issue

  • python2/python3 scripts fail to import the python module
  • When I run my python script that is copied over from Red Hat Enterprise Linux 7 or before, the following is seen:
Traceback (most recent call last):
<snip>
ImportError: No module named yum

Environment

  • Red Hat Enterprise Linux 8
  • Python 2.7
  • Python 3.6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In