Title: "make install" fails when no zlib support available
Type: compile error Stage: resolved
Components: Build Versions: Python 3.5
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Denny Weinberg, SilentGhost, dstufft, ncoghlan, ned.deily, palm.kevin
Priority: normal Keywords:

Created on 2016-07-26 13:52 by palm.kevin, last changed 2016-07-26 14:43 by ned.deily. This issue is now closed.

Messages (7)
msg271366 - (view) Author: Palm Kevin (palm.kevin) Date: 2016-07-26 13:51
It seems that on linux (red hat), the "make install" fails when no zlib support is available. (I have no zlib installed and I don't want to do so)

I reproduced the problem with both python 3.5.1 and python 3.5.2

The command 'configure' and 'make' produced no errors, but the 'make install' failed with this error message:
if test "xupgrade" != "xno"  ; then \
                case upgrade in \
                        upgrade) ensurepip="--upgrade" ;; \
                        install|*) ensurepip="" ;; \
                esac; \
                LD_LIBRARY_PATH=/usr/ls/tmp/py/Python-3.5.2:/usr/ls/app/python35/lib:./ls/lib:./ls/lib:/usr/molis/uniface9606/common/lib:/usr/molis/dlm/Linux/amd64:/usr/oracle/product/11.2.0/lib:/usr/oracle/product/11.2.0/lib: ./python -E -m ensurepip \
                        $ensurepip --root=/ ; \
Traceback (most recent call last):
  File "/usr/ls/tmp/py/Python-3.5.2/Lib/", line 184, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/ls/tmp/py/Python-3.5.2/Lib/", line 85, in _run_code
    exec(code, run_globals)
  File "/usr/ls/tmp/py/Python-3.5.2/Lib/ensurepip/", line 4, in <module>
  File "/usr/ls/tmp/py/Python-3.5.2/Lib/ensurepip/", line 209, in _main
  File "/usr/ls/tmp/py/Python-3.5.2/Lib/ensurepip/", line 116, in bootstrap
    _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/usr/ls/tmp/py/Python-3.5.2/Lib/ensurepip/", line 40, in _run_pip
    import pip
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1

zlib is not required to run Python 3.5, it should thus not be required neither for setting up python.
msg271370 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-07-26 14:02
Seems like the issue is caused by pip installation, so you should be able to fix it using --without-ensurepip switch for configure.
msg271371 - (view) Author: Palm Kevin (palm.kevin) Date: 2016-07-26 14:16
Yes. You are right. This solves the problem for me since I don't need pip.
Do you think I should close the issue or rename it into '"make install" fails with pip when missing zlib dependency' ?
msg271372 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-07-26 14:23
I wouldn't consider that an issue to be honest, the zlib is a dependency of pip and this failure is not unexpected.
msg271373 - (view) Author: Palm Kevin (palm.kevin) Date: 2016-07-26 14:28
Ok, but shouldn't it fail earlier?
During "configure" or "make", not on "make install"...
Perhaps with a message like "Unable to compile with pip because dependency zlib is missing"
msg271374 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2016-07-26 14:35
Well, there isn't anything to build in case of pip. I presume that was the decision made during the PEP implementation, so I'm adding the two core developers responsible.
msg271375 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-07-26 14:43
Building python without zlib is support is pretty unusual today and certainly not recommended. I agree that it is not worth adding more complexity to the Python configure script or Makefile to cover this edge case dependency in pip.  There are other potential ensurepip failures, for instance if ssl support is missing.
Date User Action Args
2016-07-26 14:43:28ned.deilysetresolution: not a bug -> wont fix

messages: + msg271375
nosy: + ned.deily
2016-07-26 14:35:32SilentGhostsetnosy: + ncoghlan, dstufft
messages: + msg271374
2016-07-26 14:28:06palm.kevinsetmessages: + msg271373
2016-07-26 14:23:41SilentGhostsetstatus: open -> closed
resolution: not a bug
messages: + msg271372

stage: resolved
2016-07-26 14:16:22palm.kevinsetmessages: + msg271371
2016-07-26 14:04:14Denny Weinbergsetnosy: + Denny Weinberg
2016-07-26 14:02:57SilentGhostsetnosy: + SilentGhost
messages: + msg271370
2016-07-26 13:52:00palm.kevincreate