【问题标题】:Can not Install python on mac "BigSur" 3.7.1无法在 mac“BigSur”3.7.1 上安装 python
【发布时间】:2021-01-24 09:57:05
【问题描述】:

列出版本: 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

【问题讨论】:

  • 日志/var/folders/**/T/python-build.*.log 中有什么内容?你有编译器吗?
  • 我认为在新的错误版本之前。 /var/folders/**/T/python-build.*.log 是临时的,已被删除。我会试着抓住它。它适用于以前的 mac 版本。停止在“BigSur”上工作。
  • 您肯定无法使用 pyenv 安装 3.7.1,因为它与 MacOS 11 不兼容(用于构建) - 请参阅 github.com/pyenv/pyenv/issues/1737#issuecomment-794592631

标签: macos pip pyenv macos-big-sur


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2021-12-23
    • 1970-01-01
    • 2021-08-25
    • 2021-09-20
    • 2021-04-24
    • 1970-01-01
    • 2021-11-12
    • 2014-04-20
    相关资源
    最近更新 更多