}

macOS Mojave pyenv: Install failed, "zlib not available"

Created:

Solution 1 to zlib error when compiling python

You will need to install SDK headers of xcode, you can find the installer at:

/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg eval(ez_write_tag([[300,250],'tutorials_technology-medrectangle-3','ezslot_0',114,'0','0'])); After installation executive the following command:

xcode select -s /Library/Developer/CommandLineTools

Solution 2: to "zlib not available"

When you try to install python using pyenv and you get the error:

zlib not available

Try to install python using the following CFLAGS:

eval(ez_write_tag([[250,250],'tutorials_technology-medrectangle-4','ezslot_2',137,'0','0']));eval(ez_write_tag([[250,250],'tutorials_technology-medrectangle-4','ezslot_3',137,'0','1'])); .medrectangle-4-multi-137{border:none !important;display:block !important;float:none;line-height:0px;margin-bottom:2px !important;margin-left:0px !important;margin-right:0px !important;margin-top:2px !important;min-height:250px;min-width:250px;text-align:center !important;}CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 2.7.16