I have downloaded python-3.6.1.tar.xz. then I extracted it. There is a file README.rst. this is the instruction file. and has the instruction how to install.
On Unix, Li
zipimport.ZipImportError: can't decompress data; zlib not available
You should install zlib1g-dev
and change your configure step like this:
./configure --with-zlib=/usr/include
Now, try this:
make clean
apt-get install zlib1g-dev
./configure --with-zlib=/usr/include
...
You can read more in Configure and compile Python with Zlib
When I was trying to install Python 3.7.3 through pyenv
, I got this same error. It was solved by ensuring that I had the prerequisites to my operating system, with the following:
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
I found this in pyenv Common build problems, thanks to agibalov.
On MacOS the issue is often that an XCode update has removed Zlib. Running the following will solve it:
xcode-select --install