Build libselinux with python3.11 and install python3-libselinux, libselinux, python3.11 on Centos8.6 OS
yum install python3.11 libselinux python3.11-libselinux
Running transaction
Preparing : 1/1
Installing : python3.11-libselinux-2.9-5.zncgsl6.t2.1.x86_64 1/1
Running scriptlet: python3.11-libselinux-2.9-5.zncgsl6.t2.1.x86_64 1/1
Verifying : python3.11-libselinux-2.9-5.zncgsl6.t2.1.x86_64 1/1
Installed:
python3.11-libselinux-2.9-5.zncgsl6.t2.1.x86_64
Complete!
bash-4.4# python3
Python 3.11.7 (main, Aug 1 2025, 22:52:43) [GCC 8.5.0 20210514 (Anolis 8.5.0-10.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
import selinux
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib64/python3.11/site-packages/selinux/init.py", line 13, in
from . import _selinux
ImportError: cannot import name '_selinux' from partially initialized module 'selinux' (most likely due to a circular import) (/usr/lib64/python3.11/site-packages/selinux/init.py)
Build libselinux with python3.11 and install python3-libselinux, libselinux, python3.11 on Centos8.6 OS
yum install python3.11 libselinux python3.11-libselinux
Running transaction
Preparing : 1/1
Installing : python3.11-libselinux-2.9-5.zncgsl6.t2.1.x86_64 1/1
Running scriptlet: python3.11-libselinux-2.9-5.zncgsl6.t2.1.x86_64 1/1
Verifying : python3.11-libselinux-2.9-5.zncgsl6.t2.1.x86_64 1/1
Installed:
python3.11-libselinux-2.9-5.zncgsl6.t2.1.x86_64
Complete!
bash-4.4# python3
Python 3.11.7 (main, Aug 1 2025, 22:52:43) [GCC 8.5.0 20210514 (Anolis 8.5.0-10.0.1)] on linux
Type "help", "copyright", "credits" or "license" for more information.