memo.xight.org

日々のメモ

python3.9.4 + pyenv + homebrew

Summary

% pyenv install 3.9.4
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.4.tar.xz...
-> https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
Installing Python-3.9.4...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk

BUILD FAILED (OS X 11.3 using python-build 1.2.26-9-g2924886a)

Inspect or clean up the working tree at /var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn
Results logged to /var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn.log

Last 10 log lines:
/var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn ~/Desktop
/var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn /Python-3.9.4 /var/folders/ys/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/python-build.YYYYMMDDhhmmss.nnnnn ~/Desktop
checking build system type... Invalid configuration `arm64-apple-darwin20.4.0': machine `arm64-apple' not recognized
configure: error: /bin/sh ./config.sub arm64-apple-darwin20.4.0 failed


config.subにpatch をあててインストール

timestamp='2018-04-24' のconfig.sub を timestamp='2021-01-08' に変更するパッチをあてる

% pyenv install --patch 3.9.4 <<(curl -sSL https://gist.githubusercontent.com/xight/74f84b8bde9ac6f539c3db20c2897d46/raw/cf2fd7ff5572afafb54d062f866e40d5e65cab43/config-sub.patch)
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.9.4.tar.xz...
-> https://www.python.org/ftp/python/3.9.4/Python-3.9.4.tar.xz
Installing Python-3.9.4...
patching file config.sub
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
Installed Python-3.9.4 to /Users/username/.anyenv/envs/pyenv/versions/3.9.4


Reference

GitHub Gist - xight/config-sub.patch (2018-04-24 -> 2021-01-08)
https://gist.github.com/xight/74f84b8bde9ac6f539c3db20c2897d46