Installing rpm module for (non-system) Python
python, rpm
Solution
there's no simple way to do this; the python library is part of the system rpm package and interfaces to C code, so is closely tied to the rpm package installed on your machine.
instead, it's much simpler to install an old OS in a VM (eg CentOS 5) that uses Python 2.4. then everything is consistent and works.
Problem
I need to support some software that is using an old Python version (2.4). So I have downloaded and compiled Python 2.4 and installed it in a virtualenv. So far, all OK and normal procedure. But the software is trying to import an `rpm` module. And I cannot find a source for that module (it is not part of the standard Python library, afaict). Typically, once the virtualenv is enabled (`source env/bin/activate`) I can install required software using `easy_install`. But `easy_install rpm` is failing to find anything. There is a pyrpm module, but it is not the same thing (it installs a module called "pyrpm"). And google searches are useless, as they all link to articles on how to build rpms... If I were using the system python (on Ubuntu) I could install the `python-rpm` package. But that is for Python 2.7. How do I install the equivalent for Python 2.4? [My impression is that the rpm libraries, used by many Linux systems, include a Python library, which is packaged as python-dev by the distro. But I can't see how to access that for an arbitrary python version.] I AM NOT LOOKING FOR AN RPM THAT CONTAINS PYTHON 2.4. I AM LOOKING FOR A MODULE NAMED rpm THAT IS USED BY SOFTWARE WRITTEN FOR PYTHON 2.4.