尝试在 Mac OS 11.0.1 上安装 Python 3.9.0pyenv install 3.9.0
.
Results:
python-build: use readline from homebrew
Downloading Python-3.9.0.tar.xz...
-> https://www.python.org/ftp/python/3.9.0/Python-3.9.0.tar.xz
Installing Python-3.9.0...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk
BUILD FAILED (OS X 11.0.1 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/n6/q2b78971589bltfczw539flh0000gn/T/python-build.20201114175722.7103
Results logged to /var/folders/n6/q2b78971589bltfczw539flh0000gn/T/python-build.20201114175722.7103.log
Last 10 log lines:
checking for python3... python3
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/n6/q2b78971589bltfczw539flh0000gn/T/python-build.20201114175722.7103/Python-3.9.0':
configure: error: C compiler cannot create executables
See `config.log' for more details
make: *** No targets specified and no makefile found. Stop.
类似问题中的许多建议似乎都围绕XCode,但是xcode-select --install
说命令行工具已经安装。
任何帮助表示赞赏。
我今天遇到了同样的问题,并在深入研究后设法更进一步config.log
并检查这篇文章here https://stackoverflow.com/a/63972598/5343630.
我必须采取相反的方向并执行sudo xcode-select --switch /Applications/Xcode.app/
从 App Store 下载 Xcode 后。如果你跑clang --version
它应该显示Apple clang version 12.0.0 (clang-1200.0.32.27)
.
我能够执行pyenv install 3.9.0
并通过C compiler cannot create executables
错误,但不幸的是仍然失败。config.log
这次很大,看看我能不能找到什么。
编辑:我通过执行以下命令(包括找到的补丁)成功安装了 3.8.0here https://koji-kanao.medium.com/install-python-3-8-0-via-pyenv-on-bigsur-b4246987a548.
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib" pyenv install --patch 3.8.0 < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)
已经有一些 macOS 11.0 合并,但我假设用于pyenv install
命令根本还没有更新。不过,这个解决方法目前足以满足我的需求。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)