References:
https://qiita.com/que9/items/28a9f7978fd34a620193
https://github.com/pyenv/pyenv/issues/1066#issuecomment-630939869
https://github.com/pyenv/pyenv/issues/2042#issuecomment-1131463276
https://stackoverflow.com/questions/51551557/pyenv-build-failed-installing-python-on-macos
The error:
ModuleNotFoundError: No module named '_socket'
The OS, shell and versions:
Processor: M1
OS: macOS 12.4
Shell: zsh 5.8.1 (x86_64-apple-darwin21.0)
asdf v0.10.2
The fix/workaround one-liner:
SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk \ MACOSX_DEPLOYMENT_TARGET=12.3 \ asdf install python latest
Still don't know why $SDKROOT is missing.
This similarly fixes installing Python 3.10.6 with
pyenv