Sometimes there is an annoying problem in installing new Python version, i.e. using pyenv to install Python3. I encountered this issue when I play with Ubuntu subsystem on Windows10. A typical description as follows:

BUILD FAILED (Ubuntu 16.04 using python-build 20160509)
...
zipimport.ZipImportError: can’t decompress data; zlib not available

or something like that. However, one can not fix it by just reinstall zlib and its dependencies. I finally solved it by install a bunch of packages, which means the reason is still the missing dependencies for pyenv. The solution is:

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

Similarly, for yum command:

sudo yum -y install zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel

Voila~!

Like this post? Share on: TwitterFacebookEmail


Keep Reading


Published

Category

Miscellaneous

Tags

Stay in Touch

Get Monthly Updates