无法在 Mac "BigSur" 3.7.1 上安装 python

时间:2021-01-24 09:57:05

标签: macos pip pyenv macos-big-sur

列出版本: pyenv 安装 --list | grep "3.[78]" 3.7.0 3.7-dev 3.7.1 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.8-dev 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6

安装python:

install 3.7.1
python-build: use openssl@1.1 from homebrew
python-build: use readline from homebrew
Downloading Python-3.7.1.tar.xz...
-> https://www.python.org/ftp/python/3.7.1/Python-3.7.1.tar.xz
Installing Python-3.7.1...
python-build: use readline from homebrew

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

Inspect or clean up the working tree at /var/folders/0p/tfnpx69x74z_w4kj6tjkb9tw2v9tpv/T/python-build.20210124124748.73048
Results logged to /var/folders/0p/tfnpx69x74z_w4kj6tjkb9tw2v9tpv/T/python-build.20210124124748.73048.log

Last 10 log lines:
checking for python3... python3
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... clang
checking whether the C compiler works... no
configure: error: in `/var/folders/0p/tfnpx69x74z_w4kj6tjkb9tw2v9tpv/T/python-build.20210124124748.73048/Python-3.7.1':
configure: error: C compiler cannot create executables
See `config.log' for more details

安装python 3.8.6,同样的蘑菇:

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

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

Inspect or clean up the working tree at /var/folders/0p/tfnpx69x74z_w4kj6tjkb9tw2v9tpv/T/python-build.20210124124910.74631
Results logged to /var/folders/0p/tfnpx69x74z_w4kj6tjkb9tw2v9tpv/T/python-build.20210124124910.74631.log

Last 10 log lines:
checking host system type... x86_64-apple-darwin20.2.0
checking for python3.8... python3.8
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... "darwin"
checking for gcc... clang
checking whether the C compiler works... no
configure: error: in `/var/folders/0p/tfnpx69x74z_w4kj6tjkb9tw2v9tpv/T/python-build.20210124124910.74631/Python-3.8.6':
configure: error: C compiler cannot create executables
See `config.log' for more details

1 个答案:

答案 0 :(得分:0)

这是因为您在 bigsur 上运行,但 xcode 版本较旧 - 您需要更新 xcode。