0

I am trying to add zlib package to my python. However, after I install it using "yum install zlib", only the default python (which is python 2.4.3) can import it. While the other python (3.4.4) still cannot use zlib.

When I try to import zlib in python 3.4.4 by

import zlib

It displays

Traceback (most recent call last):

File "< stdin >", line 1, in

ImportError: No module named 'zlib'

My question is, how can I install package to python which is not default?

PS. I installed both zlib and zlib-devel

Thanks

Community
  • 1
  • 1
  • 2
    `"yum install zlib"` installs library for Linux, not module for Python. – furas Oct 27 '16 at 22:47
  • I think you might need `zlib-devel` – OneCricketeer Oct 27 '16 at 22:48
  • 1
    module `zlib` is in python standard library. See: [zlib](https://docs.python.org/3/library/zlib.html). Do you get error when you `import zlib` ? Always add full error message in question. – furas Oct 27 '16 at 22:50
  • I installed zib-devel as well and still have the problem. The error information is updated. Thank you so much for your help – Guan Tianchan Oct 31 '16 at 21:34

1 Answers1

0

You might need to install the zlib-devel package as well: yum install zlib-devel. Otherwise you need to post the full error message when you try to run import zlib.

SalamalCamel
  • 65
  • 2
  • 3
  • 11
  • Thank you so much for your help. I've posted the error message. And I did install zlib-devel but seems it doesn't fix the problem – Guan Tianchan Oct 31 '16 at 21:30