[英]How to install rpm-python binding to python3 site-packages
I have python2.7 and python3.8 installed on Centos 6.10.我在 Centos 6.10 上安装了 python2.7 和 python3.8。
Current Rpm version is 4.8.0.当前的 Rpm 版本是 4.8.0。 Python2.7 is managed to import the rpm module but not Python3.8.
Python2.7 管理导入 rpm 模块,但不是 Python3.8。
These are the files in python2.7/site-packages/rpm directory这些是 python2.7/site-packages/rpm 目录中的文件
__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.如何将 rpm-python 添加到 Python3/site-packages 以便可以导入。
This is completely wrong.这是完全错误的。 Even if you copy it to python3.8 directory, it will not work.
就算复制到python3.8目录下也行不通。 Because of missing.so libraries or in incorrect version.
由于缺少.so 库或版本不正确。 Or because of incompatibilities between python2 and python3.
或者是因为python2和python3不兼容。
If you need python3 then use CentOS 8. CentOS 6 is EOLed anyway.如果您需要 python3,请使用 CentOS 8。无论如何,CentOS 6 已停产。
The Python source code for RPM is inside the RPM package. RPM 的 Python 源代码位于 RPM package 内。 You can download it from http://rpm.org/download.html
您可以从http://rpm.org/download.html下载它
And when running the configure script, make sure to specify the --enable-python
option.并且在运行配置脚本时,请确保指定
--enable-python
选项。 Python 3 should be detected, and the bindings + the libraries created and then installed.应该检测到 Python 3,并创建并安装绑定 + 库。
I just tested this with Python 3.9.6 and RPM 4.7.0我刚刚用 Python 3.9.6 和 RPM 4.7.0 测试了这个
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.