when I am using YUM package in python 2.7.5 on RHEL 7 the things are working fine,
but now we are switching to new Redhat 8 which is having python 2.7.18
and we saw that yum and rpm packages are not installed in spite we installed the following rpm's on RedHat 8
yum-4.7.0-16.el8_8.noarch
python-rpm-macros-3-41.el8.noarch
just to see the differences between Redhat 7 to RedHat 8
on RedHat 7 , we have the following folders
/usr/lib/python2.7/site-packages/yum
/usr/lib64/python2.7/site-packages/rpm
python --version
Python 2.7.5
on RedHat 8 , we not have the folders yum and rpm
ls /usr/lib/python2.7/site-packages/ | grep yum ( no output )
ls /usr/lib64/python2.7/site-packages/ | grep rpm ( no output )
python --version
Python 2.7.18
regarding to RedHat 7 , we also verified which rpm's installed in order to create the folders yum and rpm , here example from what we see
rpm -qf /usr/lib/python2.7/site-packages/yum/yumRepo.py
yum-3.4.3-168.el7.noarch
rpm -q --whatprovides /usr/lib64/python2.7/site-packages/rpm/__init__.py
rpm-python-4.11.3-48.el7_9.x86_64
so we not understand what we are misisng here on RedHat 8
why packages as yum and rpm are not installed ?
example:
python2 -c "import yum"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named yum
python2 -c "import rpm"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named rpm