Generally you will only find RPMs for the default Python version in the yum repository, however that shouldn't really be applicable here since zlib should be installed by default in your Python 2.7 installation.

Check sys.path using import sys; print sys.path and make sure that you have the lib directories for your Python 2.7 installation, it is possible that whatever you are doing in .bashrc is causing you to pick up the Python 2.4 environment.

Here is the location of my zlib module, which may be useful in trying to track down the location of yours so you can make sure it is on sys.path.

>>> import zlib
>>> zlib
<module 'zlib' from '/usr/local/lib/python2.7/lib-dynload/zlib.so'>

If you cannot find it then you should reinstall Python 2.7.

Answer from Andrew Clark on Stack Overflow
🌐
RPMfind
rpmfind.net › linux › rpm2html › search.php
RPM resource zlib-devel
The zlib-devel package contains the header files and libraries needed to develop programs that use the zlib compression and decompression library.
🌐
nixCraft
cyberciti.biz › nixcraft › howto › centos › centos linux install zlib-devel rpm package
CentOS Linux Install zlib-devel RPM Package - nixCraft
May 4, 2010 - How do I install zlib-devel (header ... line options? The zlib-devel package contains the header files and libraries needed to develop programs that use the zlib compression and decompression library....
🌐
GitHub
github.com › netdata › netdata › issues › 4573
When I try to install on centos 7 it shows the following error · Issue #4573 · netdata/netdata
November 7, 2018 - The package uuid-dev (or libuuid-devel) has to be installed. If your system cannot find libuuid, although it is installed run me with the option: –libs-are-really-here · The package zlib1g-dev (or zlib-devel) has to be installed.
Author   netdata
🌐
GitHub
github.com › netdata › netdata › issues › 93
Centos 5.5 - Sorry! NetData failed to build... The package zlib1g-dev has to be installed. · Issue #93 · netdata/netdata
March 31, 2016 - I installed the packjages required for centos as per the instructions yum install zlib-devel gcc make git autoconf autogen automake pkgconfig Installing: automake noarch 1.9.6-3.el5 base 476 k Updating: gcc i386 4.1.2-55.el5 base 5.2 M g...
Author   netdata
🌐
Cloudera Community
community.cloudera.com › t5 › Support-Questions › Can-you-please-give-the-download-link-for-zlib-compression › td-p › 161207
Can you please give the download link for zlib compression file / rpm for centos and installation step
February 8, 2017 - # cat /etc/redhat-release CentOS ... : The zlib-devel package contains the header files and libraries needed : to develop programs that use the zlib compression and decompression : library....
🌐
YumInstall
yuminstall.org › how-to-install-zlib-devel-1-2-7-18-el7-x86_64-on-centos7
How To Install zlib-devel-1.2.7-18.el7.x86_64 on CentOS7 - YumInstall
April 25, 2020 - How To Install zlib-devel-1.2.7-18.el7.x86_64 on CentOS7. Simple and short steps to install zlib-devel-1.2.7-18.el7.x86_64 on CentOS7. Linux | CentOS7 | YumInstall
🌐
RPMfind
rpmfind.net › linux › rpm2html › search.php
RPM resource zlib-devel(x86-64)
The search service can find package by either name (apache), provides(webserver), absolute file names (/usr/bin/apache), binaries (gprof) or shared libraries (libXm.so.2) in standard path. It does not support multiple arguments yet · The System and Arch are optional added filters, for example ...
Find elsewhere
🌐
CentOS Repositories
centos.pkgs.org › 7 › centos-x86_64 › zlib-devel-1.2.7-17.el7.x86_64.rpm.html
Zlib-devel Download (EOPKG, RPM, XBPS)
Download zlib-devel packages for AlmaLinux, ALT Linux, Amazon Linux, CentOS, Fedora, Mageia, OpenMandriva, openSUSE, PCLinuxOS, Rocky Linux, Solus, Void Linux
🌐
CERN
linuxsoft.cern.ch › cern › centos › 7 › updates › x86_64 › repoview › zlib-devel.html
Linux @ CERN
The zlib-devel package contains the header files and libraries needed to develop programs that use the zlib compression and decompression library.
🌐
Centos
cbs.centos.org › koji › rpminfo
zlib-devel-1.2.7-18.el7.x86_64 | RPM Info | CentOS Community Build Service
March 19, 2010 - Main Site Links: · Summary · Packages · Builds · Tasks · Build Targets · Users · Hosts · Reports · Search
🌐
GitHub
gist.github.com › caleywoods › 1197657
CentOS install · GitHub
September 6, 2011 - CentOS install. GitHub Gist: instantly share code, notes, and snippets.
🌐
GitHub
github.com › openai › gym › issues › 502
Cannot find zlib when installing gym[atari] in Cent OS 7 · Issue #502 · openai/gym
February 21, 2017 - Could not build atari-py: Command '['make', 'build', '-C', 'atari_py/ale_interface', '-j', '23']' returned non-zero exit status 2. (HINT: are you sure cmake is installed? You might also be missing a library. Atari-py requires: zlib [installable as 'apt-get install zlib1g-dev' on Ubuntu].)
Author   openai
🌐
Linux Questions
linuxquestions.org › questions › linux-software-2 › couldn't-find-package-zliblg-dev-724477
Couldn't find package zliblg-dev.
Problem with apt-get. Running Ubuntu 6.06. Attempting to compile SWFTools. There is a dependency on zlib. Searching the SWFTools forum, I find that I
🌐
Contradodigital
yum-info.contradodigital.com › view-package › installed › zlib-devel
About zlib-devel for Yum on Linux
The zlib-devel package contains the header files and libraries needed to develop programs that use the zlib compression and decompression library.