在 macOS 12.3 Monterey 上安装 Python 3.8.10 的问题

新手上路,请多包涵

有人在 macOS Monterey M1 Mac 上安装 python 3.8.10 时遇到问题吗?我尝试使用 pyenv install 安装的任何版本都会给我这个错误:

 python-build: use openssl@1.1 from homebrew python-build: use readline from homebrew Downloading Python-3.8.10.tar.xz... -> https://www.python.org/ftp/python/3.8.10/Python-3.8.10.tar.xz Installing Python-3.8.10... 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/yg/s2w3pfj172v6kdwx7hvmq65m0000gn/T/python-build.20220322155830.88129 Results logged to /var/folders/yg/s2w3pfj172v6kdwx7hvmq65m0000gn/T/python-build.20220322155830.88129.log

Last 10 log lines: checking for --with-cxx-main=<compiler>... no checking for clang++... no configure:

By default, distutils will build C++ extension modules with "clang++". If this is not intended, then set CXX on the configure command line.

checking for the platform triplet based on compiler characteristics... darwin configure: error: internal configure error for the platform triplet, please file a bug report make: *** No targets specified and no makefile found.  Stop.

我在 Google 搜索中尝试了几乎所有问题,但都没有成功 =(。我尝试使用 asdf python plugin and pyenv. 安装

原文由 honikun 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 2.5k
1 个回答

Apple 引入了一项导致其崩溃的更改。

在您的特定情况下 pyenv install 3.8.13 应该有效。

对于不同版本的其他人应该检查 这个线程

或者使用这些版本 3.7.13、3.8.13、3.9.11 和 3.10.3 中的任何一个

原文由 rahulg 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题