0

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 2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

For some reason I have to stick to CentOS 6 (32bit). Is it possible to install latest RPM to support python3 and python2?
Yes, it is possible. But you will have to install newer glibc. Which will mean you will have to install newer NetworkManager. And libselinux. And lua. And... you end up with EVERYTHING reinstalled.
0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.