centos 8 stream 安装Python 3.12.6 缺失拓展_dbm _gdbm _tkinter nis readline 处理
前言
因业务需要,在centos 8 stream 安装Python3 ,make图中发现缺失了几个非必须拓展,本想忽略,结果造成项目运行不起来。只好分析都缺失了哪些拓展。
make提示非必须拓展找不到
Checked 111 modules (31 built-in, 74 shared, 1 n/a on linux-x86_64, 0 disabled, 5 missing, 0 failed on import)
The necessary bits to build these optional modules were not found:
_dbm _gdbm _tkinter
nis readline
其他对应的拓展都好找,唯有nil-devel
没办法找到,使用yp-tools-devel
代替也不行
替换过程
libdb-devel
代替db-devel
dnf install db-devel gdbm-devel tk-devel nis-devel readline-devel
Last metadata expiration check: 0:15:39 ago on Wed 11 Sep 2024 03:04:31 PM CST.
No match for argument: db-devel
No match for argument: nis-devel
yp-tools-devel
代替nis-devel
dnf install libdb-devel gdbm-devel tk-devel yp-tools-devel readline-devel
Last metadata expiration check: 0:15:39 ago on Wed 11 Sep 2024 03:06:36 PM CST.
No match for argument: yp-tools-devel
使用dnf search 查找相关
dnf search nis
Last metadata expiration check: 1:04:41 ago on Wed 11 Sep 2024 03:04:31 PM CST.
========================================================================================== Name & Summary Matched: nis ==========================================================================================
nss_nis.i686 : Name Service Switch (NSS) module using NIS
nss_nis.x86_64 : Name Service Switch (NSS) module using NIS
varnish-devel.x86_64 : Development files for varnish
varnish-docs.x86_64 : Documentation files for varnish
varnish-modules.x86_64 : A collection of modules ("vmods") extending Varnish VCL
=============================================================================================== Name Matched: nis ===============================================================================================
genisoimage.x86_64 : Creates an image of an ISO9660 file-system
libunistring.x86_64 : GNU Unicode string library
libunistring.i686 : GNU Unicode string library
libunistring-devel.i686 : GNU Unicode string library - development files
libunistring-devel.x86_64 : GNU Unicode string library - development files
nispor.i686 : API for network status querying
nispor.x86_64 : API for network status querying
nispor-devel.i686 : API for network status querying
nispor-devel.x86_64 : API for network status querying
python3-nispor.noarch : API for network status querying
texlive-unisugar.noarch : Define syntactic sugar for Unicode LaTeX
varnish.x86_64 : High-performance HTTP accelerator
============================================================================================= Summary Matched: nis ==============================================================================================
abattis-cantarell-fonts.noarch : Cantarell, a Humanist sans-serif font family
autocorr-da.noarch : Danish auto-correction rules
autocorr-es.noarch : Spanish auto-correction rules
autocorr-fi.noarch : Finnish auto-correction rules
bind9.16-doc.noarch : BIND 9 Administrator Reference Manual
cyrus-imapd-utils.x86_64 : Cyrus IMAP server administration utilities
....省略
这次是search大法都不好使了
爆大招
经过各方查找,最后是发现libnsl2-devel
这个库是正解
此次安装拓展最后命令为
dnf install libdb-devel gdbm-devel tk-devel libnsl2-devel readline-devel
重新运行安装命令
./configure --enable-optimizations --prefix=/usr/local/python3
# 成功
make
***忽略***
Checked 111 modules (31 built-in, 79 shared, 1 n/a on linux-x86_64, 0 disabled, 0 missing, 0 failed on import)
make[1]: Leaving directory '/home/dev/soft/Python-3.12.6'
make install
# 成功
整理下相关py模块缺失对应的拓展(方便后续查阅)
modules | 拓展 |
---|---|
_dbm | libdb-devel |
_gdbm | gdbm-devel |
_tkinter | tk-devel |
nis | libnsl2-devel |
readline | readline-devel |
_ctypes | libffi-devel |