1

I've been fighting with this Python 3.6.1 install. I'm trying to get it setup so that any user can run scripts with 3.6.1. Please note that Python 2.7.5 is already installed. Any help would be greatly appreciated.

Redhat Version:

Linux version 3.10.0-514.el7.x86_64 (mockbuild@x86-039.build.eng.bos.redhat.com) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Wed Oct 19 11:24:13 EDT 2016

Python 3.6.1 Installation Errors:

Traceback (most recent call last):
  File "/usr/src/Python-3.6.1/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "/usr/src/Python-3.6.1/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/usr/src/Python-3.6.1/Lib/ensurepip/__main__.py", line 4, in <module>
ensurepip._main()
  File "/usr/src/Python-3.6.1/Lib/ensurepip/__init__.py", line 189, in _main
default_pip=args.default_pip,
  File "/usr/src/Python-3.6.1/Lib/ensurepip/__init__.py", line 102, in bootstrap
_run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/usr/src/Python-3.6.1/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1
  • How did you try to install Python 3.6.1? What is output of cat /etc/redhat-release? – fpmurphy Jul 11 '17 at 0:29
  • This is redhat 4.8.5. I have solved this issue, I'll post the answer below. – nuprap Jul 11 '17 at 19:39
1

The issue was that zlib and zlib-devel were not installed prior to install. I also needed to make sure that openssl and openssl-devel were installed and up to date, because PIP failed to function later on.

I have pasted the necessary commands and dependencies below. This was on Redhat 4.8.5.

 yum install gcc
 yum install zlib
 yum install zlib-devel
 yum install openssl
 yum install openssl-devel

 cd /usr/src
 wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
 tar xzf Python-3.6.1.tgz

 cd Python-3.6.1/
 ./configure
 make
 make altinstall

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.