Ventura系统下使用pyenv安装多版本Python失败求助
在Mac Ventura安装多版本Python(解决pyenv安装3.8.3失败问题)
问题重现
执行pyenv install 3.8.3时触发报错:
BUILD FAILED (OS X 13.2.1 using python-build 20180424) ... checking for clang++... no configure: error: internal configure error for the platform triplet, please file a bug report make: *** No targets specified and no makefile found. Stop.
解决方案
1. 更新pyenv及python-build
当前使用的python-build版本过旧(20180424),先完成更新:
- 若通过Homebrew安装pyenv:
brew update && brew upgrade pyenv
- 若通过Git克隆安装pyenv:
cd $(pyenv root) && git pull
2. 确保Xcode命令行工具完整安装
执行命令安装/更新Xcode命令行工具:
xcode-select --install
安装完成后验证clang++可用性:
clang++ --version
能正常输出版本信息则说明环境正常。
3. 指定CXX环境变量后安装Python
在执行安装命令前,先设置CXX指向系统clang++:
CXX=clang++ pyenv install 3.8.3
4. 验证安装结果
安装完成后切换版本并验证:
pyenv global 3.8.3 python --version
内容的提问来源于stack exchange,提问作者Dhruv Vashist
相关产品推荐
相关产品推荐

