zipimport.ZipImportError: can't decompress data; zlib not available
Solution 1
Ubuntu 16.10+ and Python 3.7 dev
sudo apt-get install zlib1g-dev
Note: I only put this here because it was the top search result for the error, but this resolved my issue.
Update: also the case for ubuntu 14.04LTS and base kernel at 4.1+
Solution 2
The solution is : # yum install zlib-devel
Solution 3
Simply copy paste this code:
CFLAGS="-I$(brew --prefix readline)/include -I$(brew --prefix openssl)/include -I$(xcrun --show-sdk-path)/usr/include" \
LDFLAGS="-L$(brew --prefix readline)/lib -L$(brew --prefix openssl)/lib" \
PYTHON_CONFIGURE_OPTS=--enable-unicode=ucs2 \
pyenv install -v 3.6.0
Solution 4
Throwing my 2cents. I've been dealing with this issue for the past 3 hours and realized that python3.6 for me was installed was in /usr/local/bin/.
I remade the configure with --prefix==/usr/bin and pip installed.
Installing collected packages: setuptools, pip Successfully installed pip-9.0.1 setuptools-28.8.0
Solution 5
you don't have decompress tool,You should install zlib
.
Updated Answer
first check if its installed
yum list python-gzipstream
If not then run the below to install
yum install python-gzipstream.noarch
I have this installed on my system
yum list python-gzipstream
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.webwerks.com
* epel: ftp.kddilabs.jp
* extras: centos.webwerks.com
* updates: mirror.nbrc.ac.in
Available Packages
python-gzipstream.noarch 1.4.3-1.el6 epel
Related videos on Youtube
Flair
Updated on September 18, 2022Comments
-
Flair over 1 year
On RHEL 6.6, I installed Python 3.5.1 from source. I am trying to install pip3 via get-pip.py, but I get
Traceback (most recent call last): File "get-pip.py", line 19177, 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
It works for the Python 2.6.6 installed. I have looked online for answers, but I cannot seem to find any that works for me.
edit:
yum search zlib
jzlib.i686 : JZlib re-implementation of zlib in pure Java perl-Compress-Raw-Zlib.i686 : Low-Level Interface to the zlib compression library perl-Compress-Zlib.i686 : A module providing Perl interfaces to the zlib compression library perl-IO-Zlib.i686 : Perl IO:: style interface to Compress::Zlib zlib.i686 : The zlib compression and decompression library zlib-debuginfo.i686 : Debug information for package zlib zlib-devel.i686 : Header files and libraries for Zlib development perl-IO-Compress-Zlib.i686 : Perl interface to allow reading and writing of gzip and zip data Name and summary matches only, use "search all" for everything.
-
AReddy almost 8 yearscan you show the exact command.
-
AReddy almost 8 yearscan you search for
zlib
package. -
Flair almost 8 yearsI run
python3 get-pip.py
to show the error message above, but it works forpython get-pip.py
. Yes, I can runyum search zlib
. -
Edward Falk almost 8 yearsBased on your comments, you do have zlib installed, but perhaps there's a python-zlib wrapper you need?
-
Flair almost 8 yearsHow would I go about doing that?
-
GabLeRoux over 5 yearson macos, we can
brew install zlib
🎉 -
Ralf almost 5 yearsI fixed this by copying
zlib.cpython-35m-x86_64-linux-gnu.so
to/usr/local/lib/python*/lib-dynaload
. -
Adan Rodriguez about 3 yearsIn RHEL 7, sudo yum install zlib-devel.x86_64 works for me
-
-
Flair almost 8 yearsI tried that. It says
Setting up Install Process rhel6_latest | 1.9 kB 00:00 Package zlib-devel-1.2.3-29.el6.i686 already installed and latest version Nothing to do
, but I still get the zipimport error. -
Flair almost 8 yearsI ran
yum install zlib
. I get that I already have the latest version. I still get the same error. -
AReddy almost 8 yearscheck the updated answer
-
Flair almost 8 yearsFor
yum list python-gzipstream
, I getError: No matching Packages to list
, and foryum install python-gzipstream.noarch
, I getNo package python-gzipstream.noarch available. Error: Nothing to do
-
AReddy almost 8 yearscan you show is us the output of
yum repolist
&yum search zlib
. -
Flair almost 8 yearsFor repolist,
repo id repo name status rhel6_latest Red Hat Enterprise Linux 6Server - i386 - latest 11,637 repolist: 11,637
-
Flair almost 8 yearsI put the search results in the edited question.
-
daonb over 5 yearsThanks! it helped me resolve the issue installing 3.7.1 on Ubuntu 18.04
-
jamescampbell over 4 yearsThis should be the current answer. Thanks
-
dannypaz over 3 yearsHelped resolve issue for python3+ on Ubuntu 20
-
Kirk Broadhurst over 3 yearsThis doesn't seem like RHEL.
-
Alfishe about 3 yearsIt's macOS only solution (and brew also should be installed as pre-requisite). Still - good partial solution