If you are getting the following error:
pyenv install 3.8.6python-build: use openssl@1.1 from homebrewpython-build: use readline from homebrewDownloading Python-3.8.6.tar.xz...-> https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xzInstalling Python-3.8.6...python-build: use readline from homebrewpython-build: use zlib from xcode sdkBUILD FAILED (OS X 11.1 using python-build 20180424)Inspect or clean up the working tree at /var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673Results logged to /var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673.logLast 10 log lines:mod_name, mod_spec, code = _get_module_details(mod_name)File "/private/var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673/Python-3.8.6/Lib/runpy.py", line 144, in _get_module_detailsreturn _get_module_details(pkg_main_name, error)File "/private/var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673/Python-3.8.6/Lib/runpy.py", line 111, in _get_module_details__import__(pkg_name)File "<frozen zipimport>", line 241, in load_moduleFile "<frozen zipimport>", line 709, in _get_module_codeFile "<frozen zipimport>", line 570, in _get_datazipimport.ZipImportError: can't decompress data; zlib not availablemake: *** [install] Error 1pyenv install 3.8.6 python-build: use openssl@1.1 from homebrew python-build: use readline from homebrew Downloading Python-3.8.6.tar.xz... -> https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz Installing Python-3.8.6... python-build: use readline from homebrew python-build: use zlib from xcode sdk BUILD FAILED (OS X 11.1 using python-build 20180424) Inspect or clean up the working tree at /var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673 Results logged to /var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673.log Last 10 log lines: mod_name, mod_spec, code = _get_module_details(mod_name) File "/private/var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673/Python-3.8.6/Lib/runpy.py", line 144, in _get_module_details return _get_module_details(pkg_main_name, error) File "/private/var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673/Python-3.8.6/Lib/runpy.py", line 111, in _get_module_details __import__(pkg_name) File "<frozen zipimport>", line 241, in load_module File "<frozen zipimport>", line 709, in _get_module_code File "<frozen zipimport>", line 570, in _get_data zipimport.ZipImportError: can't decompress data; zlib not available make: *** [install] Error 1pyenv install 3.8.6 python-build: use openssl@1.1 from homebrew python-build: use readline from homebrew Downloading Python-3.8.6.tar.xz... -> https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz Installing Python-3.8.6... python-build: use readline from homebrew python-build: use zlib from xcode sdk BUILD FAILED (OS X 11.1 using python-build 20180424) Inspect or clean up the working tree at /var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673 Results logged to /var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673.log Last 10 log lines: mod_name, mod_spec, code = _get_module_details(mod_name) File "/private/var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673/Python-3.8.6/Lib/runpy.py", line 144, in _get_module_details return _get_module_details(pkg_main_name, error) File "/private/var/folders/6x/cp1l4tr97y7g3jxm74n4c6v80000gn/T/python-build.20210106100539.35673/Python-3.8.6/Lib/runpy.py", line 111, in _get_module_details __import__(pkg_name) File "<frozen zipimport>", line 241, in load_module File "<frozen zipimport>", line 709, in _get_module_code File "<frozen zipimport>", line 570, in _get_data zipimport.ZipImportError: can't decompress data; zlib not available make: *** [install] Error 1
Enter fullscreen mode Exit fullscreen mode
It breaks because Python installation cannot find zlib.
The solution is easy – provide CFLAGS from the xcode sdk:
$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.8.6python-build: use openssl@1.1 from homebrewpython-build: use readline from homebrewDownloading Python-3.8.6.tar.xz...-> https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xzInstalling Python-3.8.6...python-build: use readline from homebrewpython-build: use zlib from xcode sdkInstalled Python-3.8.6 to /Users/kuba/.pyenv/versions/3.8.6$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.8.6 python-build: use openssl@1.1 from homebrew python-build: use readline from homebrew Downloading Python-3.8.6.tar.xz... -> https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz Installing Python-3.8.6... python-build: use readline from homebrew python-build: use zlib from xcode sdk Installed Python-3.8.6 to /Users/kuba/.pyenv/versions/3.8.6$ CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install 3.8.6 python-build: use openssl@1.1 from homebrew python-build: use readline from homebrew Downloading Python-3.8.6.tar.xz... -> https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz Installing Python-3.8.6... python-build: use readline from homebrew python-build: use zlib from xcode sdk Installed Python-3.8.6 to /Users/kuba/.pyenv/versions/3.8.6
Enter fullscreen mode Exit fullscreen mode
© 版权声明
THE END
暂无评论内容