It may be the same on Mac OSX 10.14.x and later, After upgrading the OS to ** 10.15.5 **, I couldn't install 2.7.x with pyenv. I will leave it as a memo.
When I install Python 2.7.13 with pyenv, I get the following error:
% pyenv install 2.7.13
python-build: use openssl from homebrew
python-build: use readline from homebrew
Downloading Python-2.7.13.tar.xz...
-> https://www.python.org/ftp/python/2.7.10/Python-2.7.10.tar.xz
Installing Python-2.7.13...
patching file ./Lib/site.py
python-build: use readline from homebrew
ERROR: The Python zlib extension was not compiled. Missing the zlib?
Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (OS X 10.15.5 using python-build 1.2.8)
Last 10 log lines:
rm -f /Users/nier/.pyenv/versions/2.7.13/share/man/man1/python.1
(cd /Users/nier/.pyenv/versions/2.7.13/share/man/man1; ln -s python2.1 python.1)
if test "xno" != "xno" ; then \
case no in \
upgrade) ensurepip="--upgrade" ;; \
install|*) ensurepip="" ;; \
esac; \
./python.exe -E -m ensurepip \
$ensurepip --root=/ ; \
fi
%
In my case, Xcode and CommandLine Tool were already installed, so I got it with the following command.
CFLAGS="-I$(xcrun --show-sdk-path)/usr/include" pyenv install -v 2.7.13
By the way, if you don't have Xcode installed, install Command Line Tool after installing Xcode.
xcode-select —install
In addition, although it is described in the error, if the above does not solve the problem, it is better to see the official document. .. https://github.com/pyenv/pyenv/wiki/Common-build-problems
Recommended Posts