在全新Mac OS X Lion上安装pythonbrew时遇到问题

0 投票
2 回答
538 浏览
提问于 2025-04-17 10:32

我安装了pythonbrew,但当我尝试安装python时,出现了一个错误:

ERROR: Failed to install Python-3.2.1. See /Volumes/Documents/Users/nathan/.pythonbrew/log/build.log to see why.

日志文件里是这么写的:

checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
checking MACHDEP... darwin
checking machine type as reported by uname -m... x86_64
checking for --without-gcc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Volumes/Documents/Users/nathan/.pythonbrew/build/Python-3.2.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

我不知道config.log文件在哪里。

有什么建议吗?

2 个回答

0

Mac OS X Lion系统默认是没有gcc这个编译器的,实际上,如果你没有安装Xcode的话,你只能使用clang(这是LLVM的C语言前端)。假设你已经安装了Xcode,那么你可以通过在配置脚本中加上without-gcc这个选项来安装Pythonbrew。

1

看起来你需要从苹果的官网上安装XCode,这样才能获得一个C语言编译器。你可以在应用商店里免费获取它,链接在这里:Xcode

不过,不幸的是,我知道的唯一获取方法就是这个,而且下载的文件非常大。

撰写回答