I trying to build older version of python such as 3.6, 3.7, 3.8 using pyenv and having build failures. I am on apple silicon and the last macOS 12.3.1. In older OS these versions would build fine. Following is the failure I get running pyenv install 3.6.9
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.6.9.tar.xz...
-> https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tar.xz
Installing Python-3.6.9...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 12.3.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/sn/46fncn513kng4ssgwn398m5h0000gn/T/python-build.20220403110510.8666
Results logged to /var/folders/sn/46fncn513kng4ssgwn398m5h0000gn/T/python-build.20220403110510.8666.log
Last 10 log lines:
checking for --with-cxx-main=<compiler>... no
checking for clang++... no
configure:
By default, distutils will build C++ extension modules with "clang++".
If this is not intended, then set CXX on the configure command line.
checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report
make: *** No targets specified and no makefile found. Stop.
Using pyenv 2.25 from homebrew on Apple Silicon with macOS 12.3.1 (21E258) / Xcode 13.3 (13E113).
For 3.6.15 you'll need this merged but unreleased pyenv patch: https://raw.githubusercontent.com/pyenv/pyenv/master/plugins/python-build/share/python-build/patches/3.6.15/Python-3.6.15/0008-bpo-45405-Prevent-internal-configure-error-when-runn.patch in /opt/homebrew/Cellar/pyenv/2.2.5/plugins/python-build/share/python-build/patches/3.6.15/Python-3.6.15/
For 3.7.12 you'll need this merged but unreleased pyenv patch: https://raw.githubusercontent.com/pyenv/pyenv/master/plugins/python-build/share/python-build/patches/3.7.12/Python-3.7.12/0004-bpo-45405-Prevent-internal-configure-error-when-runn.patch in /opt/homebrew/Cellar/pyenv/2.2.5/plugins/python-build/share/python-build/patches/3.7.12/Python-3.7.12/
3.7.13 is unreleased and currently missing merged 3.7.12 patch.
No issues with 3.8.13 build.
pyenv versions
* system (set by /Users/admin/.pyenv/version)
3.6.15
3.7.12
3.8.13