简体   繁体   English

如何将 rpm-python 绑定安装到 python3 站点包

[英]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.

相关问题 Python3 setuptools bidst_rpm:删除/usr/lib/python3.x/site-packages前缀。 使rpm安装目录适应客户端计算机的python路径 - Python3 setuptools bidst_rpm : remove /usr/lib/python3.x/site-packages prefix. Adapt rpm install directory to client machine's python path 站点包文件夹存在于 python2 但不存在于 python3 - The site-packages folder exists for python2 but not python3 除了使用 python3 在 site-packages 目录中之外,无法导入 opencv - Cannot import opencv besides in site-packages directory with python3 指向要安装到指定站点包位置的python模块 - Pointing python modules to install to a specified site-packages location Ansible 使用 python3 virtualenv 不与 python3 站点包一起使用 - Ansible using python3 virtualenv not working with python3 site-packages 如何从site-packages目录手动导入python模块? - How to manually import python modules from site-packages directory? 如何将 Python virtualenv 移动到不同的系统(计算机)并使用 Site-packages 中存在的包 - How to move Python virtualenv to different system (computer) and use packages present in Site-packages 将模块导入python脚本时如何忽略.local/lib/python3.7/site-packages/ - How to ignore .local/lib/python3.7/site-packages/ when importing a module to python script 我有 Python 3.8 的站点包,但没有解释器 - I have the site-packages for Python 3.8 but not the interpreter Python模块安装在site-packages文件夹中,但出现错误“ No module…” - Python module installed in site-packages folder, but getting error “No module …”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM