3

is this module named something else now? I can't seem to find any info saying that this module was deprecated or dropped completely. (which would confuse me further)

Anyone know where this went?

Python 3.1.2 (r312:79147, May 20 2010, 09:09:30)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gzip
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/local/lib/python3.1/gzip.py", line 9, in 
    import zlib
ImportError: No module named zlib

UPDATE: I found this in the source bundle i used Python-3.1.2/Modules/zlib/ChangeLog The last change was in 2005 and it doesn't mention anything telling.

                ChangeLog file for zlib

Changes in 1.2.3 (18 July 2005)
- Apply security vulnerability fixes to contrib/infback9 as well
- Clean up some text files (carriage returns, trailing space)
- Update testzlib, vstudio, masmx64, and masmx86 in contrib [Vollant]

[SOLVED] http://www.1stbyte.com/2005/06/26/configure-and-compile-python-with-zlib/

Brian Webster
  • 30,033
  • 48
  • 152
  • 225
MadSc13ntist
  • 431
  • 1
  • 5
  • 8
  • Can you say more about how you built this Python, and what the "configure" script said when it was looking for zlib? To me, it looks like you might have built the Python without installing the zlib-devel package, in which case Python might have concluded that you don't have a usable zlib installed. – nickm Nov 09 '10 at 14:32
  • 4
    If you've solved your question, please take the time to answer it yourself. Preferably, you'd describe how you solved it instead of just linking to a solution - for the benefit of everybody. – Stefano Palazzo Dec 01 '10 at 12:47
  • 2
    To reiterate what Stefano said above, *please* answer your own question so that this question doesn't continue to clutter up the archives. – Carter Allen Mar 15 '11 at 06:41
  • Like that part " Anyone know where this went? " ? – Jimmy Obonyo Abor Mar 04 '16 at 22:08

1 Answers1

4

(Answered by editing a URL into the question. Converted to a community wiki answer. See Question with no answers, but issue solved in the comments (or extended in chat) )

The OP wrote:

[SOLVED] http://www.1stbyte.com/2005/06/26/configure-and-compile-python-with-zlib/

SO deprecates URL only answers, and it would be inappropriate to transcribe the blog from GregTheGeek on that site. However, in summary, the steps necessary are:

  1. Install the appropriate Zlib-dev package. For example on Ubuntu it is called zlib1g-dev. This will provide the zlib.h include file.
  2. After compiling your python sources run the configure script: ./configure –with-zlib=/usr/include
  3. Now make and make install should work.
Community
  • 1
  • 1
Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129