无法在 macOS BigSur 上安装 Python 3.5.x

时间:2021-03-29 18:46:45

标签: python xcode macos gcc

在尝试安装这个弃用版本的 Python 时(是的,你没看错),我遇到了这个错误:

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

BUILD FAILED (OS X 11.2.3 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/1c/jmv2bhp51nx5dwzl46wvzx140000gn/T/python-build.20210329203655.33514
Results logged to /var/folders/1c/jmv2bhp51nx5dwzl46wvzx140000gn/T/python-build.20210329203655.33514.log

Last 10 log lines:
checking for --with-universal-archs... no
checking MACHDEP... darwin
checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/var/folders/1c/jmv2bhp51nx5dwzl46wvzx140000gn/T/python-build.20210329203655.33514/Python-3.5.5':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found.  Stop.

我正在尝试使用 pyenv 安装此特定版本。

gcc -v

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

xcode-select --version

xcode-select version 2384

几乎所有其他问题和答案都是为 Ubuntu 指定的,但这不是我的情况。

0 个答案:

没有答案