My Oracle Support Banner

Yum Command Error With ''ImportError: No module named rpm' (Doc ID 2352078.1)

Last updated on MAY 21, 2020

Applies to:

Linux OS - Version Oracle Linux 5.11 and later
Oracle Cloud Infrastructure - Version N/A and later
Linux x86-64


yum command error -  import rpm ImportError: No module named rpm.

# yum repolist

Traceback (most recent call last):
File "/usr/bin/yum", line 22, in
import yummain
File "/usr/share/yum/", line 22, in
import clientStuff
File "/usr/share/yum/", line 18, in
import rpm
ImportError: No module named rpm

# ldd /usr/bin/python => (0x00007fff9fdfd000) => /lib64/ (0x000000310f800000) => /lib64/ (0x000000310f000000) => /lib64/ (0x000000311f200000) => /lib64/ (0x000000310f400000) => /lib64/ (0x000000310ec00000)
/lib64/ (0x000000310e800000)

# which python

# python -V
Python 2.7.10



Updated few packages including  rpm-python-, as part of OS / Kernel updates.



To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.