Pyenv 一直我工作而没有问题。不知道发生了什么导致它突然无法安装任何版本。
我尝试卸载并重新安装 pyenv 无济于事,且一直提示gcc 。
[sleeli@MacBook-Pro:] ~/Downloads $ pyenv install 3.7.5
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Installing Python-3.7.5...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 12.3 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/p5/pmw3dqqx00gfpzk18dg6m5pr0000gn/T/python-build.20220513181651.29963
Results logged to /var/folders/p5/pmw3dqqx00gfpzk18dg6m5pr0000gn/T/python-build.20220513181651.29963.log
Last 10 log lines:
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... /usr/local/opt/gcc
checking whether the C compiler works... no
configure: error: in `/var/folders/p5/pmw3dqqx00gfpzk18dg6m5pr0000gn/T/python-build.20220513181651.29963/Python-3.7.5':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
而且我将系统升级了最新的macOS Monterey 12.3 CPU也是inter的,之前也一直好好的,后来经过查找,原来是升级最新Monterey系统后导致的不兼容问题
解决方案:
安装对应版本bug修复后的版本
参考bug #2143
这是由于最新的 Apple CLang 版本与 CPython 的配置不兼容。
已在3.7.13、3.8.13、3.9.11 和 3.10.3 中修复,安装大于这些子版本的即可