I installed Sonoma and installed asdf then tried to install python3.7.15.
Set path for zlib .zshrc (if you use bash => .bashrc)
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"
Then I got the following error.
asdf install python 3.7.15
python-build --patch 3.7.15 /Users/koji/.asdf/installs/python/3.7.15
with patch file from: https://github.com/python/cpython/commit/8ea6353.patch?full_index=1
python-build: use firstname.lastname@example.org from homebrew
python-build: use readline from homebrew
patching file 'Misc/NEWS.d/next/macOS/2020-06-24-13-51-57.bpo-41100.mcHdc5.rst'
patching file configure
1 out of 1 hunks failed--saving rejects to configure.rej
patching file configure.ac
1 out of 1 hunks failed--saving rejects to configure.ac.rej
BUILD FAILED (OS X 14.0 using python-build 2.3.25-6-g91002438)
Inspect or clean up the working tree at /var/folders/gj/x6v5vwdx1v7741fdfcxwmr100000gn/T/python-build.20230831024140.6153
Results logged to /var/folders/gj/x6v5vwdx1v7741fdfcxwmr100000gn/T/python-build.20230831024140.6153.log
Last 10 log lines:
3/Python-3.7.15 /var/folders/gj/x6v5vwdx1v7741fdfcxwmr100000gn/T/python-build.20230831024140.6153 ~/.asdf/plugins/python/pyenv
Execution time: 4.13s
The solution for the error was the following command
SDKROOT=/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk MACOSX_DEPLOYMENT_TARGET=14.0 asdf install python 3.7.15
In this article, I installed python3.7.15 if you get errors that are related to zlib and _scoket error, you can use the command and .zshrc settings.
I think if you try to install 3.11.x and 3.10.x, you won’t face these types of issues since I could install them without any issues.