1

Read this post

I have installed the zlib and zlib-devel in my CentOS7.2.

But why when I install the setuptools still get this error?

cd setuptools-19.6 

python3 setup.py build

python3 setup.py install

the error:

...
File "/root/setuptools-19.6/setuptools/command/bdist_egg.py", line 223, in run
    dry_run=self.dry_run, mode=self.gen_header())
  File "/root/setuptools-19.6/setuptools/command/bdist_egg.py", line 464, in make_zipfile
    z = zipfile.ZipFile(zip_filename, mode, compression=compression)
  File "/usr/local/lib/python3.6/zipfile.py", line 1098, in __init__
    _check_compression(compression)
  File "/usr/local/lib/python3.6/zipfile.py", line 647, in _check_compression
    "Compression requires the (missing) zlib module")
RuntimeError: Compression requires the (missing) zlib module

my Python3 version is Python 3.6.0a1.


EDIT-01

I get the setuptools by:

wget --no-check-certificate  https://pypi.python.org/packages/source/s/setuptools/setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26

EDIT-02

I use the 40.0.0 setuptools, still this issue.

qg_java_17137
  • 3,310
  • 10
  • 41
  • 84
  • Why you want such an ancient version of setuptools? – wim Aug 07 '18 at 04:55
  • @wim see my edit-01. – qg_java_17137 Aug 07 '18 at 05:06
  • that doesn't explain why you are using such an old version – avigil Aug 07 '18 at 05:19
  • you will probably get more help using one of the more recent releases from https://pypi.org/simple/setuptools/ – avigil Aug 07 '18 at 05:30
  • @avigil I tried the last version of setuptools, still not work. – qg_java_17137 Aug 07 '18 at 06:15
  • 2
    you are probably using a python built without zlib support. The error you are getting is because the `zlib` module is missing (`python3 -c "import zlib"` should fail). Thats something that gets added on python build so adding the libraries after the fact would not help. – avigil Aug 07 '18 at 08:04
  • @avigil seems right - did you ./configure && make this python 3.6.0a1 interpreter yourself? Why do you want to use an old alpha when 3.6.5 final (and indeed 3.7.0) is out - it could be easily installed in CentOS using yum? – wim Aug 07 '18 at 15:55

1 Answers1

1

Your problem is because of you install the zlib and zlib-devel after make install python.

now your solution should be re-make install the python. in your python directory make && make install.

and then go to setuptools for install:

python3 setup.py build
python3 setup.py install  
aircraft
  • 25,146
  • 28
  • 91
  • 166