在使用 pyenv 安装 Python 版本的时候,报错: configure: error: C compiler cannot create executables

See `config.log' for more details

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

原因是有模块依赖 Command Line Tools(命令列开发者工具),这个工具可以独立安装,不需要系统中装有 Xcode。 简单来讲 Command Line Tools 就是一个小型独立包,为 mac 终端用户提供了许多常用的工具,实用程序和编译器。包括 svn、git、make、GCC、clang、perl、size、strip、strings、libtool、cpp、what ... 以及其他很多能够在 Linux 默认安装中找到的有用的命令。 解决方案 方案一:安装最新版本的 Command Line Tools。 方案二:更新 Command Line Tools 到最新版本。 总结:直接执行下面命令,默认安装 Command Line Tools 最新版本 $ xcode-select --install

相关阅读

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: