2

I am having CentOS 6 with below python:

Default:

[root@localhost vagrant]# python
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

Custom:

[root@localhost vagrant]# python2.7
Python 2.7.13 (default, Jul  7 2017, 12:01:53)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

When I am trying to install pip using Python2.7 then getting below error:

[root@localhost vagrant]# python2.7 get-pip.py
Traceback (most recent call last):
  File "get-pip.py", line 20061, in <module>
    main()
  File "get-pip.py", line 194, in main
    bootstrap(tmpdir=tmpdir)
  File "get-pip.py", line 82, in bootstrap
    import pip
zipimport.ZipImportError: can't decompress data; zlib not available

If the installation is done via yum(I suppose uses default python) then pip gets installed successfully but I am facing issues while installing any module via pip with Error: InsecurePlatformWarning And suggests for python upgrade. How can this be fixed and has some1 face similar kind of issue?

Rohit
  • 33
  • 1
  • 5

1 Answers1

2

As the error message says, you are missing a library. Run

yum install zlib-devel

and the problem should be fixed. Note, you might need to run with sudo.

Nick Chapman
  • 4,402
  • 1
  • 27
  • 41
  • is it `zlib` or `zlib-devel`? – dlmeetei Jul 07 '17 at 12:38
  • @dlmeetei I believe it should be `zlib-devel`, are you saying it should be just `zlib`? – Nick Chapman Jul 07 '17 at 12:40
  • I think so, `devel` usually contains the `development files` – dlmeetei Jul 07 '17 at 13:04
  • @dlmeetei I'm coming from a debian background where almost everything is `apt-get install somelibrary-dev`. Do you know fi there is any harm to using `-devel` or if it just installs extra files? – Nick Chapman Jul 07 '17 at 13:05
  • There is no harm, as a practice, I don't install them if not needed. I ask the question as some may thought that it is `zlib-devel` and that relationship info was missing – dlmeetei Jul 07 '17 at 13:09