Error in installing Python 3.7 in CentOS 7.6 zipimport.ZipImportError : can’t decompress data; zlib not available

Problem description

In CentOS 7.6, when you execute make install with Python 3.7.3 source code, the following error will be reported:

(cd /usr/local/share/man/man1; ln -s python3.7.1 python3.1)
if test "xupgrade" != "xno"  ; then \
	case upgrade in \
		upgrade) ensurepip="--upgrade" ;; \
		install|*) ensurepip="" ;; \
	esac; \
	 ./python -E -m ensurepip \
		$ensurepip --root=/ ; \
Traceback (most recent call last):
  File "/home/Python-3.7.3/Lib/", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/Python-3.7.3/Lib/", line 85, in _run_code
    exec(code, run_globals)
  File "/home/Python-3.7.3/Lib/ensurepip/", line 5, in 
  File "/home/Python-3.7.3/Lib/ensurepip/", line 204, in _main
  File "/home/Python-3.7.3/Lib/ensurepip/", line 117, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/home/Python-3.7.3/Lib/ensurepip/", line 27, in _run_pip
    import pip._internal
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1

System version

[[email protected] ]# cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

Python version




yum install zlib zlib-devel -y

Similar Posts: