skip to Main Content

I have python2.7 and python3.8 installed on Centos 6.10.

Current Rpm version is 4.8.0. Python2.7 is managed to import the rpm module but not Python3.8.

These are the files in python2.7/site-packages/rpm directory

__init__.py
__init__.pyo
__init__.pyc
_rpmmodule.so
_rpmbmodule.so
transaction.py 
transaction.pyc
transaction.pyo

How to add the rpm-python to Python3/site-packages so that it can be imported.

2

Answers


  1. This is completely wrong. Even if you copy it to python3.8 directory, it will not work. Because of missing .so libraries or in incorrect version. Or because of incompatibilities between python2 and python3.

    If you need python3 then use CentOS 8. CentOS 6 is EOLed anyway.

    Login or Signup to reply.
  2. The Python source code for RPM is inside the RPM package.
    You can download it from http://rpm.org/download.html

    And when running the configure script, make sure to specify the --enable-python option.
    Python 3 should be detected, and the bindings + the libraries created and then installed.

    I just tested this with Python 3.9.6 and RPM 4.7.0

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search