zlib not available during python 3.7.0 install through pyenv, how can I fix this? zlib not available during python 3.7.0 install through pyenv, how can I fix this? python-3.x python-3.x

zlib not available during python 3.7.0 install through pyenv, how can I fix this?


Specifically for Python 3.7.0 I did the following with success:

Brew gives some nice instructions when you run info zlib

$ brew info zlib...For compilers to find zlib you may need to set:  export LDFLAGS="-L/usr/local/opt/zlib/lib"  export CPPFLAGS="-I/usr/local/opt/zlib/include"...

So given these instructions, I simply cut/paste FTW :)

$ export LDFLAGS="-L/usr/local/opt/zlib/lib"$ export CPPFLAGS="-I/usr/local/opt/zlib/include"$ pyenv install 3.7.0   # Succeeded


I had the same problem. First i tried to install python manually with

./configure --prefix /usr/local/var/pyenv/versions/3.5.5/makemake install

Build completed, but i got errors about openssl and zlib , too. Then i tried again with changed build environment:

export CPPFLAGS="-I/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -I$(brew --prefix openssl)/include"export LDFLAGS="-L/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib -L$(brew --prefix openssl)/lib"

Which succeeded.

Finally i ran in the same shell (with both exported variables):

pyenv install 3.5.5

Which succeeded, too :-)HTH