2.7.18 是唯一支持m1平台的2代版本 3.9.1 是支持m1平台最小的版本
Cannot build 2.7.18 on Apple Silicon #2136
pyenv install 2.7.18 BUILD FAILED (OS X 12.3): ld: symbol(s) not found for architecture x86_64: “_Py_Main”, referenced from: _main in python.o #2283
Unable to use pyenv to install Python 3.7.0 in Mac Big Sur, no module named _socket #2042
1. brew install openssl@1.1 readline zlib bzip2
2. brew uninstall binutils
3. 设置编译环境, pyenv会通过brew自动选择openssl和readline, 如果环境
正常, 这两个库可以不指定, 不然还是要设置到`CPPFLAGS`和`LDFLAGS`
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include -I/opt/homebrew/opt/openssl@1.1/include -I/opt/homebrew/opt/readline/include -I/opt/homebrew/opt/zlib/include -I/opt/homebrew/opt/bzip2/include"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib -L/opt/homebrew/opt/openssl@1.1/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/zlib/lib -L/opt/homebrew/opt/bzip2/lib"
4. macOS环境
export MACOSX_DEPLOYMENT_TARGET=12.6
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk