Dear All:
I am trying to install Python 3.10.4 on my virtual machine Rocky Linux 8.6.
But I have an issue that I don’t know how to solve it.
After compiling python, I saw message below:
Python build finished successfully!
The necessary bits to build these optional modules were not found:
nis
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
I’d tried to check from the file “setup.py” and found below:
def detect_nis(self):
if MS_WINDOWS or CYGWIN or HOST_PLATFORM == 'qnx6':
self.missing.append('nis')
return
libs = []
library_dirs = []
includes_dirs = []
# bpo-32521: glibc has deprecated Sun RPC for some time. Fedora 28
# moved headers and libraries to libtirpc and libnsl. The headers
# are in tircp and nsl sub directories.
rpcsvc_inc = find_file(
'rpcsvc/yp_prot.h', self.inc_dirs,
[os.path.join(inc_dir, 'nsl') for inc_dir in self.inc_dirs]
)
rpc_inc = find_file(
'rpc/rpc.h', self.inc_dirs,
[os.path.join(inc_dir, 'tirpc') for inc_dir in self.inc_dirs]
)
if rpcsvc_inc is None or rpc_inc is None:
# not found
self.missing.append('nis')
return
includes_dirs.extend(rpcsvc_inc)
includes_dirs.extend(rpc_inc)
if self.compiler.find_library_file(self.lib_dirs, 'nsl'):
libs.append('nsl')
else:
# libnsl-devel: check for libnsl in nsl/ subdirectory
nsl_dirs = [os.path.join(lib_dir, 'nsl') for lib_dir in self.lib_dirs]
libnsl = self.compiler.find_library_file(nsl_dirs, 'nsl')
if libnsl is not None:
library_dirs.append(os.path.dirname(libnsl))
libs.append('nsl')
if self.compiler.find_library_file(self.lib_dirs, 'tirpc'):
libs.append('tirpc')
self.add(Extension('nis', ['nismodule.c'],
libraries=libs,
library_dirs=library_dirs,
include_dirs=includes_dirs))
According to the codes above and my limited linux knowledge, I guess that I should miss these 2 tools:
“libnsl” and “libtirpc”.
However, after trying to install them via dnf:
sudo dnf install libnsl
sudo dnf install libtirpc
it told me both packages have been installed already.
So, I am stuck here now.
Can someone kindly give me any hint to solve this problem?
Thank you.